SSH with Two-Factor Authentication (using Google Authenticator)

Warning!

  • At your own risk.

  • Your system time must be accurate (recommendation using NTP)

  • Stored in a safe place unique codes generated during the installation

- Not for newbies (sorry!)

  • Tested in MyBookLive 02.42.03-027

1)  Download and install the Google Authenticator

for Windows PC: 

https://code.google.com/p/winauth/

for mobile:

https://support.google.com/accounts/answer/1066447?hl=en

  1. Install lib required

apt-get install libqrencode3

  1. Download packed (Debian Wheezy - PowerPC)

wget http://ftp.us.debian.org/debian/pool/main/g/google-authenticator/libpam-google-authenticator_20130529-2_powerpc.deb

  1. Install it

dpkg -i libpam-google-authenticator_20130529-2_powerpc.deb

  1. Configure the app running:

google-authenticator

Now activate !

a) Add this line in the file (nano /etc/pam.d/sshd)

auth required pam_google_authenticator.so

b) Modify (or add if no present) this line in the file (nano /etc/ssh/sshd_config)

ChallengeResponseAuthentication yes

c) Restart service

/etc/init.d/ssh restart

Please, check in other session that you can get login before close the actual session. 

You might return back your changes, If you mess up you can block the account!!!

Only valid for the actual account.

Regards

BoraBora

1 Like

Thanks for sharing.