News for hackers. Stuff that matters.
Re:OpenSSH Server Best Practices (security related) by peterwwillis on Tuesday October 23, 2012 @12:08PM (#4688724)
(edit: a method for this is already in the story, but this is slightly more flexible/secure) Rate limit incoming SSH connections:

  iptables -A INPUT -i eth0 -p tcp -m tcp --dport 22 -m conntrack --ctstate INVALID -j DROP
  iptables -A INPUT -i eth0 -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set --name SSH --rsource
  iptables -A INPUT -i eth0 -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 5 --rttl --name SSH --rsource -j DROP
  iptables -A INPUT -i eth0 -p tcp -m tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT

There are no comments on this comment yet.