freeradiusfreeipa

How can I make FreeIPA & FreeRadius work with PEAP authentication


I want to force our office users to enter their LDAP credentials when connecting to the WiFi in our office. So I installed FreeRadius as instructed at: Using FreeIPA and FreeRadius .

Using radtest, I can successfully authenticate against our FreeIPA server using PAP. Moving on I configured a WiFi connection on my Windows 10 laptop to use EAP-TTLS as the authentication method along with selecting PAP as the non-EAP method. Again I can successfully authenticate against our FreeIPA server when connecting to the WiFi AP. But I realize that is not safe since passwords are sent as clear-text.

So next I configured a WiFi connection on my Windows 10 laptop to use PEAP as the authentication method with EAP method of EAP-MSCHAP v2. But now authentication fails. An excerpt from the FreeRadius debug log shows:

(8) mschap: WARNING: No Cleartext-Password configured.  Cannot create NT-Password 
(8) mschap: WARNING: No Cleartext-Password configured.  Cannot create LM-Password 
(8) mschap: Creating challenge hash with username: test55 
(8) mschap: Client is using MS-CHAPv2 
(8) mschap: ERROR: FAILED: No NT/LM-Password.  Cannot perform authentication 
(8) mschap: ERROR: MS-CHAP2-Response is incorrect

I’m struggling to figure out a solution. I have found various configurations of eap, mschap & ldap files online but so far I have not solved my issue.

I’m not sure if I’m asking the right question but is the password hash sent by the Windows client incompatible with the password hash used by FreeIPA?


Solution

  • It turns out mschapv2 is a challenge response protocol, and that does not work with an LDAP bind in the basic configuration of FreeRadius.

    However I did find a solution where FreeRadius looks up a user by their LDAP DN, then reads (not bind) the NTHash of the user. From there, FreeRADIUS is able to process the challenge response.

    First permissions have to be given to service accounts: https://fy.blackhats.net.au/blog/html/2015/07/06/FreeIPA:_Giving_permissions_to_service_accounts..html

    After performing these steps users will need to change their password in order to generate an ipaNTHash.

    Then configure FreeRadius to use mschapv2 with FreeIPA: https://fy.blackhats.net.au/blog/html/2016/01/13/FreeRADIUS:_Using_mschapv2_with_freeipa.html

    After completing all the steps described in both links, this radtest cli command should return an Access-Accept response.

    radtest -t mschap <ldap-user-uid> <ldap-user-password> 127.0.0.1:1812 0 <FreeRadius-secret>