2FA via FreeRADIUS Ignoring Password – Solution Guide

freeradiusradiustwo-factor-authentication

I've been tasked with setting up freeRADIUS to prompt a user for their second authentication factor (eg. Google Authenticator OTP) BUT without first checking the user's password.

I'm coming into this completely blind, with no prior RADIUS experience. We have a webapp that prompts the user to sign in so the password authentication is already done. We then need to prompt the user for a second authentication factor in order to perform certain actions. We don't want to repeatedly ask the user to enter their password (and caching it locally is a no-no, apparently) so what we'd like to do is configure freeRADIUS somehow so that it will:

  • Ignore the value that we pass for the password in the initial request
  • Return a challenge response which will prompt the user to enter their second authentication factor (eg. OTP)

Is this even feasible? Like I said, I don't have any prior RADIUS experience, so apologies if this is a dumb question.

Best Answer

I figured this out myself. If anyone is interested, it's related to the configuration in /etc/pam.d/radiusd

First, follow one of these tutorials to set up Google Authenticator as the second factor on your freeRADIUS server:
https://networkjutsu.com/freeradius-google-authenticator/ https://www.supertechguy.com/help/security/freeradius-google-auth/

When it comes to making changes to /etc/pam.d/radiusd, use one of these configurations:

  1. To prompt for password AND Google Auth OTP:

    auth requisite pam_google_authenticator.so forward_pass
    auth required pam_unix.so use_first_pass
    account required pam_unix.so audit
    account required pam_permit.so

  2. To prompt JUST for the Google Auth OTP (i.e. no password):

    auth required pam_google_authenticator.so
    account required pam_unix.so audit
    account required pam_permit.so

Note that this doesn't send a challenge response - it just means that the password doesn't need to be entered in the first place.

Related Topic