News for hackers. Stuff that matters.
Re:Add two-factor authentication to your ssh in 30 seconds by jlgreco on Tuesday August 28, 2012 @03:51PM (#4445559)
Unless I am mistaken, it should be possible to configure opensshd to first try using keys, then fall back on UsePAM only if that fails (similar to how sshd will normally fall back on PasswordAuthentication).

If not, it might be possible to configure PAM with some sort of keys module set to 'sufficient', then have PAM fall back on two-factor auth paired with pam_unix.

In fact, I'll see if I can get either of those working a bit later today. Seems like it could be neat.

Re:Add two-factor authentication to your ssh in 30 seconds by guiambros on Wednesday August 29, 2012 @12:54AM (#4447156)
Another option is to whitelist your ip address, and then require 2-factor auth only when you're connecting from a non-whitelisted ip address.

Of course this leaves you a vulnerable to ip spoofing, but adds a ton of convenience and could be a good trade-off.

Re:Add two-factor authentication to your ssh in 30 seconds by meik on Wednesday August 29, 2012 @04:22AM (#4447560)
Yeah but (blind) IP spoofing over the Internet is infeasible nowadays. Maybe 15 years ago when ISN randomization was not the rule (successful attack described in http://web.textfiles.com/hacking/shimomur.txt)

But that's correct, in recent openssh versions, it seems that you can add specific-host-only rules for authentication etc.