Complete Reference with Copy-Paste Examples
Part of The Direct Path to Linux Ubuntu
— free for all students and developers.
LDAP is the backbone of enterprise identity — Active Directory, FreeIPA, and OpenLDAP authenticate millions of users every day.
LDAP enables SSO — log into one system, automatically authenticated everywhere: email, VPN, databases, web apps, Linux servers.
Add one user in LDAP and they can immediately log into 100 systems — no per-system account management needed.
PAM, NSS, SSH, sudo, Apache, and Nginx all integrate with LDAP. Understanding LDAP is essential for Linux system administration.
Run LDAP:
# Install OpenLDAP sudo apt install slapd ldap-utils sudo dpkg-reconfigure slapd # setup wizard # Command-line tools ldapsearch -x -H ldap://localhost -b "dc=example,dc=com" "(uid=alice)" ldapadd -x -H ldap://localhost -D "cn=admin,dc=ex,dc=com" -W -f add.ldif ldapmodify -x -H ldap://localhost -D "cn=admin,dc=ex,dc=com" -W -f mod.ldif ldapdelete -x -H ldap://localhost -D "cn=admin,dc=ex,dc=com" -W "uid=bob,ou=users,dc=ex,dc=com" ldapwhoami -x -H ldap://localhost -D "uid=alice,ou=users,dc=ex,dc=com" -W # Python pip install ldap3 # pure Python, recommended pip install python-ldap # C binding (older)