Miles Davis Ars longa, vita brevis

Archive for November, 2006

Stop SSH scanning with iptables

11.11.2006 · Posted in BOFH

Basically, you define in iptables your local nets and accept SSH automatically: -A INPUT -p tcp --dport 22 -s -j ACCEPT (repeat as necessary) And then you define a block for repeated attempts for others: iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --set --name SSH iptables -A INPUT -p ...