Setup Ubuntu For LDAP Authentication

First you must install all the needed packages:

apt-get install libpam-ldap libnss-ldap nss-updatedb libnss-db

As part of the install process you will have to answer questions such as ldap version, domain name, ip address of your ldap server.

Above and beyound the packages you need to configure some authentication and login system files

Edit /etc/nsswitch.conf

Change the file so that files ldap replaces compat.

#passwd: compat

passwd: files ldap

#group: compat

group: files ldap

If this is working correctly when you use this command:

getent passwd

You should see similar /etc/passwd like output: .

Edit /etc/pam.d/common-account

You will need to edit the file so you have these two lines.

account sufficient

account required

Edit /etc/pam.d/common-auth

auth sufficient

auth required nullok_secure use_first_pass

Edit /etc/pam.d/common-password

password sufficient

password required nullok obscure min=4 max=8 md5

Your ubuntu box should now be set up for ldap authentication