Created
December 10, 2015 07:04
-
-
Save ViKingIX/b8c1fbb17886ef48186c to your computer and use it in GitHub Desktop.
block brute force ssh login
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
iptables -A SSH -m conntrack --ctstate NEW -m recent --set --name ssh --mask 255.255.255.255 --rsource | |
iptables -A SSH -m recent --update --seconds 30 --hitcount 6 --name ssh --mask 255.255.255.255 --rsource -j DROP | |
iptables -A SSH -m recent --update --seconds 15 --hitcount 2 --name ssh --mask 255.255.255.255 --rsource -j DROP | |
iptables -A SSH -j ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment