Using hashlimit to foil SSH bruteforce attempts

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

Comments

Popular posts from this blog

Pull files off Android phone