Iptables SSH brute-force protection Print

  • iptables, brute-force protection, ssh
  • 0

Some iptables rules that are useful to increase the overall security of a Linux server.

#SSH brute-force protection
/sbin/iptables -A INPUT -p tcp --dport ssh -m conntrack --ctstate NEW -m recent --set 
/sbin/iptables -A INPUT -p tcp --dport ssh -m conntrack --ctstate NEW -m recent --update --seconds 60 --hitcount 10 -j DROP  

#Protection against port scanning
/sbin/iptables -N port-scanning 
/sbin/iptables -A port-scanning -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s --limit-burst 2 -j RETURN 
/sbin/iptables -A port-scanning -j DROP


Was this answer helpful?

« Back

Powered by WHMCompleteSolution