Copied from HOW TO: Configure LDAP for SUDO Support on Ubuntu Server 9.10 (Karmic Koala)
With some addition text by me and works on Ubuntu 13.04
1.) Install LDAP Client Configuration
TIP! Have your LDAP IP, Base Name, Admin Account and Admin Password Handy before executing this command.
sudo apt-get install libnss-ldap
…nCurses based setup screen will ask you information about your LDAP setup
II. Enable LDAP Support in PAM system
sudo auth-client-config -t nss -p lac_ldap
III. Verify PAM based LDAP Support
sudo pam-auth-update
NOTE: Skip Step 2 for installation on the LDAP server as we already did this above!
2.) Install sudo-ldap package
I. You will need to drop fully into root mode for this part!
sudo su
II. Turn off SUDO safety switch
export SUDO_FORCE_REMOVE=yes
III. Get package
apt-get install sudo-ldap
IV. Turn on SUDO Safety switch
export SUDO_FORCE_REMOVE=no
V. Drop back to user-land mode
exit
3.) Manually setup sudo redirection from /etc/sudoers to LDAP directory
WARNING: Take note of the double “>>” in line, you do NOT want to accidentally blow out your file!
sudo echo "sudoers_base ou=SUDOers,dc=example,dc=com" >> /etc/ldap.conf
II. Symbolically link Sudo Ldap Config file to main LDAP config file
NOTE: This is not obvious in ANY documentation I have reviewed, only support forums reveled this.
This file (sudo-ldap.conf) may already exist so check and rename if so
sudo ln -s /etc/ldap.conf /etc/sudo-ldap.conf
III. Add support for sudo / ldap communication in NS Switch configuration
WARNING: Take note of the double “>>” in line, you do NOT want to accidentally blow out your file!
The below line might already be in the file (nsswitch.conf) so chcek and one run if not. On my system is was already there.
sudo echo "sudoers: ldap" >> /etc/nsswitch.conf
So good luck 🙂