In this article I will show you how to setup and configure SSH for two-factor authentication under Red Hat, CentOS, Fedora and Ubuntu, Linux Mint and Debian.
Installing Google Authenticator Module
Open the machine that you want to setup two factor authentication and install following PAM libraries along with development libraries that are needed for the PAM module to work correctly with Google authenticator module.
On Red Hat, CentOS and Fedora systems install the 'pam-devel' package.
# yum install pam-devel make gcc-c++ wget
On Ubuntu, Linux Mint and Debian systems install 'libpam0g-dev' package.
# apt-get install libpam0g-dev make gcc-c++ wget
Download and extract Google authenticator module under Home directory (assume you are already logged in home directory of root).
# cd /root
# wget https://google-authenticator.googlecode.com/files/libpam-google-authenticator-1.0-source.tar.bz2
# tar -xvf libpam-google-authenticator-1.0-source.tar.bz2
Type the following commands to compile and install Google authenticator module on the system.
# cd libpam-google-authenticator-1.0
# make
# make install
# google-authenticator
Read more: Tecmint.com
QR: