Re:Finally iptables works the same on every Linux distro
by yrro on Monday September 02, 2013 @07:23PM
(#6317770)
Does pam_abl work when you're not using PAM for authentication--only for authorization ("account") and session management? e.g., when UsePAM is enabled, but ChallengeResponseAuthentication and PasswordAuthentication are disabled.
I believe this is the problem with using pam_tally2. Then again, if you're only allowing PubkeyAuthentication then maybe you don't care about brute force login attempts so much.
Even if fail2ban and others were perfect, all it would take is the sysadmin customizing the log format to include some random field and all the sudden it's possible for an attacker to block every IP address with one request.
Source: http://seclists.org/fulldisclosure/2007/Jun/138
A better alternative is something like pam_abl which only protects logins to a user on the system but with it ssh is essentially unbruteforceable.