Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm wondering if there is some kine of 2 factor authentication module which supports PAM. My dovecot(PAM), postfix(SASL) and openssh authenticate via PAM to the system users. I would like to have it do 2 factor authentication, maybe via yubikey, google authenticator or whatever. And also, how would my mail client handle that?

share|improve this question
up vote 1 down vote accepted

Really, you want to choose the proper authentication protocol that is supported by PAM, the services you want to protect and the broadest number of two-factor authentication servers.

Radius is the answer.

All major two-factor authentication systems support radius. Radius is supported in PAM through the pam-radius plugin. Radius will also allow you to proxy the requests through freeradius (or NPS on AD) which can then perform authorization against your directory. (Meaning that you have one location to disable users.)

We have a number of tutorials that should help: a couple on pam-radius: &

And this one on adding two-factor auth to webmail that covers sasl etc.

The email clients will be prompted for an OTP each time they launch or for each session.

Pam-tacacs and pam-ldap would be other options, but more difficult and less flexible, IMO.

share|improve this answer

Google Authenticator has a PAM module. The instructions for it are here. I'm not sure how it would work with mail.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.