Created
December 11, 2012 03:29
-
-
Save ScrambledBits/4255708 to your computer and use it in GitHub Desktop.
SSH Dictionary Attack Prevention with iptables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
iptables -N SSH_CHECK | |
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j SSH_CHECK | |
iptables -A SSH_CHECK -m recent --set --name SSH | |
iptables -A SSH_CHECK -m recent --update --seconds 60 --hitcount 4 --name SSH -j DROP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment