Monday, December 13, 2010

Port Blocking in Linux

For example i am blocking FTP port which is 21.
We can block ports using GUI and command line in Linux.

Command line:

Rejecting:

iptables -A INPUT -p tcp --dport 21 -j REJECT
Enabling:

iptables -A INPUT -p tcp --dport 21 -j ACCEPT

Before Enabling or blocking the port flush the iptables using the command

iptables --flush

Using GUI:
go to the system configuration and open firewall and uncheck the service which is running on the port which u want 2 disable.

For further Info See the below links:


No comments:

Post a Comment