How to Block SSH and FTP Access to Specific IP and Network Range in Linux

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Senthil Kumar

A Linux Consultant, living in India. He loves very much to write about Linux, Open Source, Computers and Internet. Apart from that, He'd like to review Internet tools and web services.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

5 Responses

  1. Cherif says:

    with TCP Wrappers you don’t have too restart sshd or vsftpd.

  2. kishor says:

    # firewall-cmd –direct –add-rule ipv4 filter INPUT 1 -m tcp –source -p tcp –dport 22 -j REJECT <—-here can we put
    #iptables -I INPUT -s -p tcp –dport ssh -j ACCEPT <—-here can we put

  3. Ehsan says:

    Thanks for the tutorial. First of all can’t we do it with rich rule ?? I asked a question to many expert. I am having a FTP server , around 30 users from accross the world send some file on that server. previously i used iptable and give access to them and later i denied all . and that works fine. What is my question is that in firewalld richrule or direct rule do i need to do any deny rule after all the permit rule ??

    I havn’t got any ans. regarding it . Could you please tell me do i need to and if so then what would be the systex ??


  4. Mayuresh Mulye says:

    Very nice and simple article !

    Thanks !

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?