How to Enable Two-Factor on SSH
sudo apt-get install libpam-google-authenticator
source from: https://code.google.com/p/google-authenticator/
Now run "google-authenticator" as the user you want to generate a key for.
|Add the code to your smartphone using the Google Authenticator app|
Next you have to setup Google Authenticator for SSH logins.
Open the /etc/pam.d/sshd file on your system
sudo nano /etc/pam.d/sshd and add the following line to the file:
auth required pam_google_authenticator.so
Open the /etc/ssh/sshd_config file, go to the ChallengeResponseAuthentication line, and change it to:
(If the ChallengeResponseAuthentication line doesn’t exist, add it.)
Restart the SSH server, these commands depend on your distribution:
sudo service ssh restart
systemctl restart sshd
Backup your Google Authenticator
(This location may vary. But it's in the general area)
Then use sqlite to pull the data. Or cat the file.