How to block IP address in Linux via ssh:

The following command will drop any packet coming from the IP address

iptables -I INPUT -s -j DROP


iptables -A INPUT -s -j DROP

(-I inserts into config, -A appends)

Use the following syntax to block on eth1 public interface:
iptables -i eth1 -A INPUT -s -j DROP

Use the following command to view:
iptables -L -v

Use the following command to save:
service iptables save

Posted in centos, malicious attacks, virtuozzo containers and tagged , , .