Hmmm, so richtig zufrieden bin ich damit noch nicht. Die Sache mit dem Hitcount scheint sich nur sehr bedingt wieder zu erholen (vielleicht braucht man auch noch Regeln mit –remove?). Bis dahin habe ich mir mal so geholfen:
# throttle to 5 connections per minute (FIXME: hitcount does not seem to work) # iptables -A ssh -m recent --update --seconds 60 --hitcount 5 --name SSH -j REJECT iptables -N ssh iptables -A ssh -m recent --rcheck --seconds 10 --name SSH -j LOG --log-level info --log-prefix "SSH scan blocked: " iptables -A ssh -m recent --update --seconds 10 --name SSH -j REJECT iptables -A ssh -m recent --set --name SSH -j ACCEPT iptables -A INPUT -p tcp --destination-port 22 -j ssh iptables -A FORWARD -p tcp --destination-port 22 -j ssh