Is pam_captcha worth using? (Securing your sshd)
Posted Wed, 19 Jul 2006
Jul 19 04:37:21 dns sshd: Invalid user test from 188.8.131.52 Jul 19 04:37:22 dns sshd: Invalid user guest from 184.108.40.206 Jul 19 04:37:26 dns sshd: Invalid user user from 220.127.116.11No authentication failures, just invalid user notifications.
FreeBSD has (for a while?) disabled simple "password" authentication in it's base sshd config. What does this mean? If client connects requesting only "password" authentication, it will be rejected. Period. Example:
dns(~) !255! % ssh -o "PreferredAuthentications password" [email protected] Permission denied (publickey,keyboard-interactive).If you check /var/log/auth.log, you'll see:
Jul 19 06:10:32 dns sshd: Invalid user happytest from 192.168.0.252However, try the same with a valid user. Nothing is logged (by default). Still, you are denied outright.
The important point, is that I guess pam_captcha is not necessary at this time. Every ssh client I have used has supported both public-key and keyboard-interactive authentication, so disabling 'password' everywhere should be a viable option. FreeBSD disables password auth by default, and no one seems to be complaining.
If you're worried about brute force attacks over ssh, then just disable 'password' authentication. In sshd_config:
PasswordAuthentication noThis probably requires that you use public-key or keyboard-interactive (PAM) to authenticate. Keeps normal users happy, and blocks brute force bots. That is, until the bot scripts are updated to use keyboard-interactive, perhaps? Who knows...