Home > Uncategorized > Block FTP access using Iptables

Block FTP access using Iptables

September 4th, 2012 Leave a comment Go to comments

 Iptables block ftp access

Completely disable the FTP access on the server using below iptables rule:

iptables -A INPUT -p tcp –dport 21 -j DROP

If you want to block FTP access for a Specific IP then run the below command:

 iptables -A INPUT -p tcp -s 10.10.10.10 –dport 21 -j DROP

To Disable FTP access for Specific Subnet:

 iptables -I INPUT -p tcp -s 10.10.10.10/24 –dport 21 -j DROP

After adding the adding rules you need to save the rules by running the command:

/etc/init.d/iptables save

Then to apply the above saved rules, restart the IPtables by running the command:

/etc/init.d/iptables restart

Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.