Coredump

Work, play, and everything in-between.

Archive for the ‘iptables’ tag

Using hashlimit to foil SSH bruteforce attempts

without comments

Add this to the iptables ruleset:

iptables -A INPUT -m hashlimit -m tcp -p tcp --dport 22 --hashlimit 1/min --hashlimit-mode srcip --hashlimit-name ssh -m state --state NEW -j ACCEPT

The rule limits one connection to the SSH port from one IP address per minute.

For more information, man iptables and iptables -m hashlimit --help.

Reference: https://www.redhat.com/archives/fedora-test-list/2005-August/msg00061.html

Written by Ian Dexter

January 4th, 2006 at 9:12 am

Posted in Work

Tagged with , , ,