Kerberos - Radius does not get password

Khapare Joshi khapare77 at gmail.com
Fri Dec 28 15:03:10 CET 2012


or I have just written how to with kerberos and freeradius, this will help
you

Freeradius with MIT kerberos Authentication
===========================================

I have successfully installed and configured MIT kerberos and Freeradius
Authentication. This might be helpful for some people who are interested in
doing this. Perhaps FR guys will add this into their wiki.

Why I am doing this ?
=====================
I have been running Eduroam service on freeradius and Active Directory for
user authentication. In order to use Active Directory, I had
to configure samba and winbind. Lately, I had too many problems
with winbind and samba which require frequent restart the daemon both smb
and winbind. I ended up writing some cron to do this for me. I feel this is
not reliable and looked for alternative solution. I came up
with four different solution.

1. Continue using Freeradius with Active directory for user authentication
and maintain ill winbind plus samba
2. Customize the LDAP (openLdap) so that password can be stored in NT-HASH
or LMHASH or whatever is compatible, so you do not have to worry about SMB,
Winbind
3. Forget about FreeRadius and choose Microsoft IAS or their $ application
so that you do not have to worry samba,winbind freeradius :)
4. Deploy kerberos, integrate with OpenLDAP, configure FreeRadius to use
Kerberos for user authentication.

I preferred point number 4. and implemented, Now since it is working fine I
am thinking of going in production. Here is what I did:

I assume you have already working Kerberos server if not here are the
instruction how to install MIT kerberos in LINUX
http://www.linux-mag.com/id/4738/


1. Add the hostprincipal and service principal for your Freeradius server
kadmin$ ank -randkey radius/radiusserver.example.com at EXAMPLE.COM
kadmin$ ank -randkey host/radiusserver.example.com at EXAMPLE.COM


2. Add user principal for testing:
kadmin$ add_principal krbtesting # this will prompt you a password - just
type whatever you want, in my case I typed krbtesting as my password
 your userprincipal will be krbtesting at EXAMPLE.COM

3. you need to dump the keytab file,

kadmin$ ktadd -k /tmp/krb5.keytab host/radiusserver.example.com at EXAMPLE.COM
kadmin$ ktadd -k /tmp/krb5.keytab radius/
radiusserver.example.com at EXAMPLE.COM

4. so you have the keytab file, if you like test it. This can be done as
this :

test15$ kinit -k -t /tmp/krb5.keytab radius/
radiusserver.example.com at EXAMPLE.COM
test15$ kinit -k -t /tmp/krb5.keytab host/
radiusserver.example.com at EXAMPLE.COM


5. Copy krb5.keytab file to your freeradius server

You are done with Kerberos. let install the freeradius

On Centos you can do :
=================
test15# yum install freeradius freeradius-krb5 freeradius-utils -y

For basic kerberos authentication test you just need to configure few files
under /etc/raddb
1. Edit /etc/raddb/modules/krb5.conf and add the following
krb5 {
      keytab = /etc/krb5.keytab # make sure this keytab file is readble by
radius daemon change the path where your keytab file is
      service_principal = radius/radiusserver.example.com
 }

2. Add Auth-Type kerberos in /etc/raddb/sites-enabled/default right after
the PAP like this:
Auth-Type Kerberos {
     krb5
}
PS: Kerberos only works with PAP

3. Add DEFAULT AUTH-Type = kerberos (without quote "") on top of your
/etc/raddb/users file

4. Now, start your freeradius in debug mode, radiusd -X

Lets test the authentication, open another terminal and issue the following
command:

test15$ radtest krbtesting krbtesting localhost 0 testing123

Where, username is krbtesting and password is krbtesting, radiusserver is
localhost and seceret is testing123. The aim here is to get Accept-Accept,
here is what I get:

Fri Dec 28 10:50:57 2012 : Info: ++[expiration] returns noop
Fri Dec 28 10:50:57 2012 : Info: ++[logintime] returns noop
Fri Dec 28 10:50:57 2012 : Info: [pap] WARNING! No "known good" password
found for the user.  Authentication may fail because of this.
Fri Dec 28 10:50:57 2012 : Info: ++[pap] returns noop
Fri Dec 28 10:50:57 2012 : Info: Found Auth-Type = Kerberos
Fri Dec 28 10:50:57 2012 : Info: # Executing group from file
/etc/raddb/sites-enabled/default
Fri Dec 28 10:50:57 2012 : Info: +- entering group kerberos {...}
Fri Dec 28 10:50:57 2012 : Debug: rlm_krb5: verify_krb_v5_tgt: host key not
found : Permission denied
Fri Dec 28 10:50:57 2012 : Info: ++[krb5] returns ok
Fri Dec 28 10:50:57 2012 : Auth: Login OK: [krbtesting] (from client
localhost port 0)
Fri Dec 28 10:50:57 2012 : Info: # Executing section post-auth from file
/etc/raddb/sites-enabled/default
Fri Dec 28 10:50:57 2012 : Info: +- entering group post-auth {...}
Fri Dec 28 10:50:57 2012 : Info: [reply_log] expand:
/var/log/radius/radacct/%{Client-IP-Address}/reply-detail-%Y%m%d ->
/var/log/radius/radacct/127.0.0.1/reply-detail-20121228
Fri Dec 28 10:50:57 2012 : Info: [reply_log]
/var/log/radius/radacct/%{Client-IP-Address}/reply-detail-%Y%m%d expands to
/var/log/radius/radacct/127.0.0.1/reply-detail-20121228
Fri Dec 28 10:50:57 2012 : Info: [reply_log] expand: %t -> Fri Dec 28
10:50:57 2012
Fri Dec 28 10:50:57 2012 : Info: ++[reply_log] returns ok
Fri Dec 28 10:50:57 2012 : Info: ++[exec] returns noop
Sending Access-Accept of id 248 to 127.0.0.1 port 34456

The key thing here is to get Login OK and krb5 returns ok, if you see those
you have successfully authenticated against your freeradius with kerberos
server. There is warning and permission denied messages,
see earlier post and Alan's reply.

on your terminal you will see output as this :

[test at test15]# radtest krbtesting krbtesting localhost 0 testing123
Sending Access-Request of id 248 to 127.0.0.1 port 1812
 User-Name = "krbtesting"
User-Password = "krbtesting"
 NAS-IP-Address = 192.168.1.25
NAS-Port = 0
Message-Authenticator = 0x00000000000000000000000000000000
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=248,
length=20


I have tested EAP-TTLS - PAP with wpa_supplicant and it works well too.
Also I tested following devices that allows EAP-TTLS and PAP:
Sonny Ericksson mobile
samsung galaxy s II
samsung galaxy note
windows 8 (thank you Dr. Bill you enabled other selection apart from PEAP)
Fedora 17
windows 7 requries securew2 to make it work (it works though)

Hope this helps.



On Thu, May 10, 2012 at 4:10 PM, Phil Mayers <p.mayers at imperial.ac.uk>wrote:

> On 10/05/12 16:39, Jörg Herzinger wrote:
>
>> Hi,
>>
>> Radius has been bugging me now for over a week and I just can't get it
>> working with Kerberos over WLan. I have been trying around a lot but in
>>
>
> There's no such thing as "kerberos over WLAN"
>
> wireless authentication is either:
>
>  * MAC address (no radius involved)
>  * shared secret (no radius involved)
>  * WPA-Enterprise i.e. 802.1x
>
>
>  root at donauauen42 ~ # radtest testing pass radius 1 averysecretsecret
>> Sending Access-Request of id 166 to 192.168.43.118 port 1812
>> User-Name = "testing"
>> User-Password = "pass"
>> NAS-IP-Address = 192.168.42.42
>> NAS-Port = 1
>>
>
> This is a plain PAP request, and as such not representative of
> WPA-Enterprise.
>
> You should download the wpa_supplicant sources, and compile "eapol_test"
> to test 802.1x authentication.
>
>
>  Not working Kerberos debug log: http://pastie.org/3890159
>>
>
> These logs show 802.1x i.e. WPA-Enterprise authentication. You are using
> EAP-TTLS, with EAP-MD5 inner. The log is clear:
>
> [eap] EAP/md5
>
> [eap] processing type md5
> rlm_eap_md5: Cleartext-Password is required for EAP-MD5 authentication
> [eap] Handler failed in EAP/md5
> [eap] Failed in EAP select
>
> The "kerberos" module can only authenticate PAP, because it's an "oracle".
> See:
>
> http://deployingradius.com/**documents/protocols/oracles.**html<http://deployingradius.com/documents/protocols/oracles.html>
>
> For these purposes, you may consider Kerberos to be equivalent to PAM.
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/**
> list/users.html <http://www.freeradius.org/list/users.html>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20121228/70559f99/attachment.html>


More information about the Freeradius-Users mailing list