I've seen walkthroughs to set up 2-factor authentication for ssh on linux boxes. Is there any way to do it on OSX?
2-factor authentication for ssh
Securityssh
Securityssh
I've seen walkthroughs to set up 2-factor authentication for ssh on linux boxes. Is there any way to do it on OSX?
Best Answer
Shamelessly stolen here: Enable Google two-factor authentication for SSH connections on OS X and updated:
Prerequisites on the remote host:
Other prerequisites:
Install google-authenticator-libpam:
Add the following line in sshd:
Reload ssh:
Install and configure Google Authenticator on your iPhone (or a similar device)
Set up Google Authenticator on the remote host interactively or non-interactively. Example:
Use
google-authenticator -h
to sho the options.Connect to the remote host after setting up the Google Authenticator PAM module on the remote host and Google Authenticator on your mobile device (adding the token for your user and remote host!):
To get around the error "Failed to use libqrencode to show QR code visually for scanning." install libqrencode with brew:
and create a QR.png yourself if you don't want to create the QR code at google.com by omitting the first part of the URL and starting with otauth...: