I'm trying to setup 2 Factor Authentication. I want the user to login successfully if:
- The public private/public key matches (authentication method: publickey) or the password is correct
- My pam authentication method is successful.
The second authentication method is a PAM file. So I place it into
/usr/lib/pam/ and added
auth required my_pam_module.so in
So far I can either log in using the (publickey method) or (a password and whatever is required by me pam module). So I added
AuthenticationMethods publickey,keyboard-interactive in
/etc/sshd_config and now I'm required to have the public key, password, and "whatever is required by me pam module".
What lines do I need to change in order to achieve what I described above? I'm using Mac OS X Mavericks (10.9). If you aren't familiar with Mac, it could also help what you'd do on your Linux system.