Secure SSH with Google Authenticator’s Two-Factor Authentication

Medical Technology, Healthcare & Government IT

Category Groups

To install the package on Ubuntu, run the following command:

sudo apt-get install libpam-google-authenticator

Activate Google Authenticator

Next you’ll have to require Google Authenticator for SSH logins. To do so, open the/etc/pam.d/sshd file on your system (for example, with the sudo nano /etc/pam.d/sshd command) and add the following line to the file:

auth required

Next, open the sshd_config file, locate theChallengeResponseAuthentication line, and change it to read as follows:

ChallengeResponseAuthentication yes

(If the ChallengeResponseAuthentication line doesn’t already exist, add the above line to the file.)

Finally, restart the SSH server so your changes will take effect:

sudo service ssh restart

Create an Authentication Key
Log in as the user you’ll be logging in with remotely and run the google-authenticatorcommand to create a secret key for that user.
Finally, restart the SSH server so your changes will take effect:


Google Authenticator will present you with a secret key and several emergency scratch codes. Write down the emergency scratch codes somewhere safe they can only be used one time each, and they’re intended for use if you lose your phone.

Official application (Google Authenticator app) are available for Android, iOS, and Blackberry.
Download and install the application.

While executing the application it will ask for secret key.

clonidine online, buy clomid online

Then you will getting the verification codes and you’ll now have a constantly changing verification code on your phone.

Windows Operating System:

Execute the exe file

After running the program and a little padlock icon appears in the system tray. The context menu lets you enter your secret key.

Then Then you will getting the verification codes.

Note: We can create separate keys for each user.

Original Link