radius to pam with 2FA from duo
Hello, I am trying to get FreeRADIUS working with 2FA. I have it mostly setup. I can see in the debug output that saying my user exists in the system. However I'm still getting Access-Reject from my client. Here is the output from FreeRADIUS (using the FreeRADIUS repo):0) Received Access-Request Id 98 from 10.150.1.190:37142 to 10.150.1.153:1812 length 92 (0) User-Name = "test" (0) User-Password = "Password!1234" (0) NAS-IP-Address = 10.150.1.190 (0) NAS-Port = 0 (0) Message-Authenticator = 0xef25474df3491218de56a2d8874cfe47 (0) # Executing section authorize from file /etc/raddb/sites-enabled/default (0) authorize { (0) policy filter_username { (0) if (&User-Name) { (0) if (&User-Name) -> TRUE (0) if (&User-Name) { (0) if (&User-Name =~ / /) { (0) if (&User-Name =~ / /) -> FALSE (0) if (&User-Name =~ /@[^@]*@/ ) { (0) if (&User-Name =~ /@[^@]*@/ ) -> FALSE (0) if (&User-Name =~ /\.\./ ) { (0) if (&User-Name =~ /\.\./ ) -> FALSE (0) if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/)) { (0) if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/)) -> FALSE (0) if (&User-Name =~ /\.$/) { (0) if (&User-Name =~ /\.$/) -> FALSE (0) if (&User-Name =~ /@\./) { (0) if (&User-Name =~ /@\./) -> FALSE (0) } # if (&User-Name) = notfound (0) } # policy filter_username = notfound (0) [preprocess] = ok (0) [chap] = noop (0) [mschap] = noop (0) [digest] = noop (0) suffix: Checking for suffix after "@" (0) suffix: No '@' in User-Name = "test", looking up realm NULL (0) suffix: No such realm "NULL" (0) [suffix] = noop (0) eap: No EAP-Message, not doing EAP (0) [eap] = noop (0) files: Failed resolving GID: No error (0) files: users: Matched entry DEFAULT at line 70 (0) [files] = ok (0) [expiration] = noop (0) [logintime] = noop Not doing PAP as Auth-Type is already set. (0) [pap] = noop (0) } # authorize = ok (0) Found Auth-Type = pam (0) # Executing group from file /etc/raddb/sites-enabled/default (0) authenticate { (0) pam: Using pamauth string "radiusd" for pam.conf lookup (0) pam: ERROR: pam_authenticate failed: Error in service module (0) [pam] = reject (0) } # authenticate = reject (0) Failed to authenticate the user (0) Using Post-Auth-Type Reject (0) # Executing group from file /etc/raddb/sites-enabled/default (0) Post-Auth-Type REJECT { (0) attr_filter.access_reject: EXPAND %{User-Name} (0) attr_filter.access_reject: --> test (0) attr_filter.access_reject: Matched entry DEFAULT at line 11 (0) [attr_filter.access_reject] = updated (0) [eap] = noop (0) policy remove_reply_message_if_eap { (0) if (&reply:EAP-Message && &reply:Reply-Message) { (0) if (&reply:EAP-Message && &reply:Reply-Message) -> FALSE (0) else { (0) [noop] = noop (0) } # else = noop (0) } # policy remove_reply_message_if_eap = noop (0) } # Post-Auth-Type REJECT = updated (0) Delaying response for 1.000000 seconds Waking up in 0.3 seconds. Waking up in 0.6 seconds. (0) Sending delayed response (0) Sent Access-Reject Id 98 from 10.150.1.153:1812 to 10.150.1.190:37142 length 20 Waking up in 3.9 seconds. (0) Cleaning up request packet ID 98 with timestamp +38 Ready to process requests Here is my radiusd pam configuration [root@radius01 ~]# cat /etc/pam.d/radiusd #%PAM-1.0 #auth include password-auth auth requisite pam_duo.so forward_pass account required pam_nologin.so account include password-auth password include password-auth session include password-auth [root@radius01 ~]# [test@console02 ~]$ radtest test Password!1234123456 10.150.1.153 0 password! Sent Access-Request Id 98 from 0.0.0.0:37142 to 10.150.1.153:1812 length 92 User-Name = "test" User-Password = "Password!1234123456" NAS-IP-Address = 10.150.1.190 NAS-Port = 0 Message-Authenticator = 0x00 Cleartext-Password = "Password!1234123456" Received Access-Reject Id 98 from 10.150.1.153:1812 to 0.0.0.0:0 length 20 (0) -: Expected Access-Accept got Access-Reject [test@console02 ~]$ Should I have changed the radius pam config file? Should I have changed the password-auth config file instead? Eventually I want this work with SSH.
On Jul 26, 2019, at 12:55 PM, Andrew Meyer via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
Hello, I am trying to get FreeRADIUS working with 2FA. I have it mostly setup. I can see in the debug output that saying my user exists in the system. However I'm still getting Access-Reject from my client.
Here is the output from FreeRADIUS (using the FreeRADIUS repo)
(0) Received Access-Request Id 98 from 10.150.1.190:37142 to 10.150.1.153:1812 length 92 (0) User-Name = "test" (0) User-Password = "Password!1234" (0) NAS-IP-Address = 10.150.1.190 (0) NAS-Port = 0 (0) Message-Authenticator = 0xef25474df3491218de56a2d8874cfe47 ... (0) pam: Using pamauth string "radiusd" for pam.conf lookup (0) pam: ERROR: pam_authenticate failed: Error in service module (0) [pam] = reject
That error comes from PAM, not from FreeRADIUS.
[root@radius01 ~]# cat /etc/pam.d/radiusd #%PAM-1.0 #auth include password-auth auth requisite pam_duo.so forward_pass account required pam_nologin.so account include password-auth password include password-auth session include password-auth [root@radius01 ~]#
Something in that config is wrong, or is saying "no user". What's wrong? I don't know. PAM is fanatical about producing useless errors. And it's been ~15 years since I did anything with PAM.
Should I have changed the radius pam config file? Should I have changed the password-auth config file instead? Eventually I want this work with SSH.
I have no idea. Ask the PAM people how their software works. Alan DeKok.
participants (2)
-
Alan DeKok -
Andrew Meyer