Google Authenticator Ubuntu ssh

This guide will enable Google Authenticator verification when logging in to ssh from a remote location. First install libpam-google-authenticator

Answer the questions posed during installation. If you are not asked any questions while installing, run google-authenticatorSave the emergency scratch codes somewhere safe, they will be your way back if you loose your phone. Open your Google Authenticator app. Use the Menu key and select Set up account. Use the Scan a barcode feature and scan the barcode in your terminal. Next do

Add the following

Edit your sshd_config

Find and uncomment/add the following line

Create a file in /etc/security called access-local.conf

Add this:

Restart ssh

You should now be asked for verification when you login from a remote site but not from your local network

Be the first to comment

Leave a Reply