Friday, April 22, 2016

How to set up Two Factor Authentication Google Authenticator on FreeBSD

How to set up Two Factor Authentication Google Authenticator on FreeBSD

# pkg install pam_google_authenticator-20140826_1
# pkg install libqrencode

# su - johndoe -c google-authenticator

Note: A configuration file is then written to ~/.google-authenticator

# vim /etc/pam.d/sshd

auth   required   pam_unix.so   no_warn try_first_pass
auth   required  /usr/local/lib/pam_google_authenticator.so

# vim /etc/ssh/sshd_config

Match User johndoe
    AuthenticationMethods keyboard-interactive

When login:

Authenticated with partial success.

Reference:

https://sysconfig.org.uk/two-factor-authentication-with-ssh.html

No comments: