Linux
-
Download OpenLDAP:
sudo apt update sudo apt install slapd ldap-utils sudo apt install ldap-utils -
Configure OpenLDAP:
sudo dpkg-reconfigure slapdDNS domain name:
example.orgPassword:
root -
Create
user.ldif:# ldap is the username dn: uid=ldap,dc=example,dc=org objectClass: inetOrgPerson objectClass: posixAccount uid: ldap sn: LDAP givenName: LDAP cn: LDAP User displayName: LDAP User uidNumber: 10000 gidNumber: 10000 homeDirectory: /home/ldap loginShell: /bin/bash -
Add the user to the OpenLDAP server:
ldapadd -x -D "cn=admin,dc=example,dc=org" -W -f user.ldif -
Start and check the status of OpenLDAP:
sudo systemctl start slapd sudo systemctl status slapd -
View current users:
ldapsearch -x -LLL -b "dc=example,dc=org" "(objectclass=inetOrgPerson)" uid userPassword -
Change user password:
ldappasswd -x -D "cn=admin,dc=example,dc=org" -W -S "uid=ldap,dc=example,dc=org"