Web anvari.org
Anvari.Org
» Anvari.Org → System Administration

Restrict SSH Using IpTables


Well, it's not as hard as it seems:

iptables -D INPUT -m tcp -p tcp --dport 22 -j DROP
iptables -A INPUT -m tcp -p tcp --dport 22 --source {ip-address-goes-here} -j ACCEPT
iptables -A INPUT -m tcp -p tcp --dport 22 -j DROP





Retrieved from http://www.anvari.org/cols/System_Administration/Restrict_SSH_Using_IpTables.html