I've been going through quite a few OpenLDAP configuration steps already, but there are still new setup possibilities to try. I'm not sure if I'm always too curious or if it's just the new Ubuntu Lucid that is making me try how these things are working with it.
Now that MIT Kerberos is running using OpenLDAP as storage backend, the next logical step is to make OpenLDAP use MIT Kerberos as its password backend. If one needs both kerberos ja ldap bind authentication working, it's really easy to get some of those passwords out of sync. Users are usually not happy if they suddenly start having randomly different passwords for different services when they change their password. Until now I've been using tools that always update the different passwords (userPassword in ldap, ntml hash for samba and kerberos) at the same time, but sometimes there have been problems making sure that all actually changed.
To make syncing possible, I'll be going through the steps to get OpenLDAP to forward the ldap binds to SASL which in turn forwards them to Kerberos using GSSAPI. This solution works when there is need to support ldap binds for applications that don't support kerberos directly. This shouldn't be mistaken for real kerberos authentication as this solution still needs the user password to be sent to OpenLDAP over the wire.
The following documents tell more background information and were used to do the configuration described in this posting:
- Wikipedia on SASL
- RFC #4422 - Simple Authentication and Security Layer (SASL)
- OpenLDAP's Pass-Through authentication
What I'll be using here is OpenLDAP's pass-through authentication that replaces the user's password with instructions to use SASL, e.g.:
userPassword: {SASL}username@REALM
To get started with the setup you should have working OpenLDAP + MIT kerberos setup as described in the earlier postings. On top of these the following packages are needed on the machine running OpenLDAP server:
sudo apt-get install sasl2-bin libsasl2-modules-gssapi-mit
START=yes DESC="SASL Authentication Daemon" NAME="saslauthd" MECHANISMS="kerberos5" MECH_OPTIONS="" THREADS=5 OPTIONS="-c -m /var/run/saslauthd"
user@server:~$ ls -ld /var/run/saslauthd drwx--x--- 2 root sasl 140 2010-03-04 09:47 /var/run/saslauthd
sudo adduser openldap sasl
testsaslauthd -u user@EDU.EXAMPLE.ORG -p userpassword
0: OK "Success."
0: NO "authentication failed"
ldapsearch -D uid=user,ou=people,dc=edu,dc=example,dc=org -W -b dc=edu,dc=example,dc=org
sudo /usr/sbin/saslauthd -a kerberos5 -m /var/run/saslauthd -d
Veli-Matti Lintu