I am looking to add my own 2-factor authentication to my ubuntu linux server with c++. I am going to have my asterisk box call my cell phone with a unique ID, which must be entered at the linux login prompt, before or after a password, with (or) without a certificate – depending on how I configure it. Either way, I’d like this extra entry step as a part of the login.
Should I use PAM for this? If so, can someone point me to a sample of extra input w/Pam and login?
I’ve written a c++ application to change the password of accounts listed in a MySQL database to be “Pin Number” + OpenSSL Library’s RNG to create a 8 letter password – it combines them and forces a password change every 60 seconds.