Configuring Ubuntu machine as LDAP client
From Notes_Wiki
Home > Ubuntu > Server or Desktop administration > Configuring Ubuntu machine as LDAP client
To configure Ubuntu machine as LDAP client use:
- Install required package using:
- sudo apt-get install ldap-utils libpam-ldap libnss-ldap nslcd
- Edit '/etc/nsswitch.conf' and append ldap to shadow, passwd and group such as shown below:
- passwd: compat ldap
- group : compat ldap
- shadow: compat ldap
- To ensure that users home folder automatically get created at login edit '/etc/pam.d/login' and add below line along with other session required lines:
- session required pam_mkhomedir.so skel=/etc/skel umask=0022
- Also add the same session required line to '/etc/pam.d/lightdm' file.
- Enable nslcd service to run automatically on start-up using:
- sudo update-rc.d nslcd enable
- Restart nscd service using:
- /etc/init.d/nscd restart
- Verify connection to LDAP server is working using:
- ldapsearch -x -h <LDAP-server> -z 5
- Verify that user information is being recognized properly using:
- getent passwd
- getent group
- getent shadow
- Try to login as LDAP user using 'ssh <username>@localhost' assuming package 'openssh-server' is installed and ssh server is running. Note that system may ask you to reset password during first login.
Steps learned from https://askubuntu.com/questions/127389/how-to-configure-ubuntu-as-an-ldap-client
Home > Ubuntu > Server or Desktop administration > Configuring Ubuntu machine as LDAP client