Add two-factor authentication to your ssh in 30 seconds
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 instructions; then, edit /etc/pam.d/sshd, and add "auth required pam_google_authenticator.so" in a new line; edit /etc/ssh/sshd_config and add (or change) the ChallengeResponseAuthentication line so it reads "ChallengeResponseAuthentication yes"; and finally, sudo service ssh restart to restart the ssh server.More info is available from the packager of libpam-google-authenticator[1], and from the Google Authenticator PAM module's README.[2]--[1] http://blog.theroux.ca/security/ubuntu-2-step-authentication...[2] http://code.google.com/p/google-authenticator/source/browse/...--Edits: Corrected typos; added more context.