R-Ts NetWorks

Server the Best

Block FTP access using Iptables


 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

Advertisements

September 4, 2012 - Posted by | Uncategorized

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: