Enable Google Authenticator 2FA for SSH

· 1 min read
Enable Google Authenticator 2FA for SSH

Ubuntu:

$ sudo apt-get install libpam-google-authenticator

Debian:

$ sudo apt-get install libqrencode3
$ wget http://ftp.us.debian.org/debian/pool/main/g/google-authenticator/libpam-google-authenticator_20191231-1_amd64.deb
$ sudo dpkg -i libpam-google-authenticator_20191231-1_amd64.deb

Configure:

$ google-authenticator

$ sudo vi /etc/pam.d/sshd
Add to the bottom:
auth required pam_google_authenticator.so

$ sudo vi /etc/ssh/sshd_config
Set ChallengeResponseAuthentication yes

$ sudo /etc/init.d/ssh restart

Related Articles

Android 12 Developer Preview 1
· 2 min read
Misc Linux tips and tricks
· 2 min read
Virtualbox PCI Passthrough Notes
· 1 min read

Virtualbox Admin

I run several machines on top of Virtual Box on Debian (headless). Here some notes I made... Install latest version

· 2 min read