restrict ftp access using iptables

Assume the server’s IP address is 125.121.156.156. Now we can block all ftp connections to the server withe the following ip tables rule
iptables -I INPUT -s 0.0.0.0 -d125.121.156.156 -p tcp -m tcp –dport 21 -j DROP
Now we can allow only authorised ip by the folloing rule. Assume the IP to be allowed is 121.125.121.125
iptables -I INPUT -s 121.125.121.125 -d 125.121.156.156 -p tcp -m tcp –dport 21 -j ACCEP

Now save the iptables rule using following command
/etc/init.d/iptables save

You can leave a response, or trackback from your own site.

Leave a Reply

Subscribe without commenting


Fatal error: Call to undefined function wp_list_addonn() in /home/sites/customers/aneesh/systemadmin/blog/wp-content/themes/Grante/sidebar.php on line 106