Using a third-party service like authy.com has its advantages, but if you prefer, you can get two-factor authentication in the latest Ubuntu without involving a third party by installing libpam-google-authenticator from Ubuntu's "universe" repository. Here's how you do it: first, sudo apt-get install libpam-google-authenticator ; second, run google-authenticator as the user you will access remotely and follow the ins…
The biggest problems is you can't use ssh_keys with this setup. Its too restrictive, and certificates are a must for ssh. Also what happens if you loose your cellphone? We thought about this and for us the possibility of loosing access to the server fully was too much.
Add two-factor authentication to your ssh in 30 seconds
31–40 of 108 posts
Re: Add two-factor authentication to your ssh in 30 seconds
#32Earlier quoted context omitted.
The biggest problems is you can't use ssh_keys with this setup. Its too restrictive, and certificates are a must for ssh. Also what happens if you loose your cellphone? We thought about this and for us the possibility of loosing access to the server fully was too much.
danielpal: google-authenticator prints out emergency scratch codes you can use if you lose your cellphone :-)
Re: Add two-factor authentication to your ssh in 30 seconds
#33This is great but one thing bugs me. When you add a new user, you have to restart SSH? Wouldn't that prevent people from connecting every time a new user is added?
Re: Add two-factor authentication to your ssh in 30 seconds
#34Using a third-party service like authy.com has its advantages, but if you prefer, you can get two-factor authentication in the latest Ubuntu without involving a third party by installing libpam-google-authenticator from Ubuntu's "universe" repository. Here's how you do it: first, sudo apt-get install libpam-google-authenticator ; second, run google-authenticator as the user you will access remotely and follow the ins…
Re: Add two-factor authentication to your ssh in 30 seconds
#35Using a third-party service like authy.com has its advantages, but if you prefer, you can get two-factor authentication in the latest Ubuntu without involving a third party by installing libpam-google-authenticator from Ubuntu's "universe" repository. Here's how you do it: first, sudo apt-get install libpam-google-authenticator ; second, run google-authenticator as the user you will access remotely and follow the ins…
The biggest problems is you can't use ssh_keys with this setup. Its too restrictive, and certificates are a must for ssh. Also what happens if you loose your cellphone? We thought about this and for us the possibility of loosing access to the server fully was too much.
I also believe I once ran across a patch someone had done to the login code to allow both to be required, I can't find the link right off though as I'm at work currently. If I find it, I'll add it here
Re: Add two-factor authentication to your ssh in 30 seconds
#36If you start pushing insecure technologies like this, people will just get really comfortable with them and eventually get taken advantage of.
Re: Add two-factor authentication to your ssh in 30 seconds
#37Missing. The. Point.
Re: Add two-factor authentication to your ssh in 30 seconds
#38This is great but one thing bugs me. When you add a new user, you have to restart SSH? Wouldn't that prevent people from connecting every time a new user is added?
Even if you restart the ssh server it won't prevent people from connecting to the server because SSH forks the clients.
Re: Add two-factor authentication to your ssh in 30 seconds
#39Earlier quoted context omitted.
danielpal: google-authenticator prints out emergency scratch codes you can use if you lose your cellphone :-)
Yeah but in reality no-one writes it down. I actually use Google-Auth for my Gmail, but I forgot were I wrote this number down(it was a couple of years ago). Keeping a scratch code for each new server is a pain.
Re: Add two-factor authentication to your ssh in 30 seconds
#40Pretty cool. Google authenticator is another alternative that be used via a pam module, with the additional benefit that it doesn't need to connect to something else for verification. https://code.google.com/p/google-authenticator/
the problem is that google authenticator stores the seed in the phone(and the server) so if you lose it basically you lose the server too, right?
If you lose your phone and your scratch codes, you've only lost access via SSH. So it's an inconvenience, but one you can overcome with the right setup.