Gistrec

Anti ssh-bruteforce with Iptables

Jun 21st, 2017
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.51 KB | None | 0 0
  1. # Создание правила для входящего соединения
  2. # -p tcp   протокол tcp
  3. # -m tcp ... ДОПИСАТЬ
  4. iptables -A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m hashlimit --hashlimit 1/hour --hashlimit-burst 2 --hashlimit-mode srcip --hashlimit-name SSH --hashlimit-htable-expire 60000 -j ACCEPT
  5.  
  6. iptables -A INPUT -p tcp -m tcp --dport 22 --tcp-flags SYN,RST,ACK SYN -j DROP
  7.  
  8. iptables -A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
Add Comment
Please, Sign In to add comment