Ubuntu 26.04

OpenLDAP : Configure LDAP Server2026/05/22

 

Configure LDAP Server in order to share user accounts in your local networks.

[1] Install OpenLDAP.
root@dlp:~#
apt -y install slapd ldap-utils
# set LDAP admin password during installation like follows

 +--------------------------| Configuring slapd |-------------------------+
 | Please enter the password for the admin entry in your LDAP directory.  |
 |                                                                        |
 | Administrator password:                                                |
 |                                                                        |
 | ********______________________________________________________________ |
 |                                                                        |
 |                                 <Ok>                                   |
 |                                                                        |
 +------------------------------------------------------------------------+

# confirm settings

root@dlp:~#
slapcat

dn: dc=srv,dc=world
objectClass: top
objectClass: dcObject
objectClass: organization
o: srv.world
dc: srv
structuralObjectClass: organization
entryUUID: 4e31e1e0-e9c0-1040-8741-ef7610e8402c
creatorsName: cn=admin,dc=srv,dc=world
createTimestamp: 20260522002413Z
entryCSN: 20260522002413.936633Z#000000#000#000000
modifiersName: cn=admin,dc=srv,dc=world
modifyTimestamp: 20260522002413Z
[2] Add base dn for Users and Groups.
root@dlp:~#
vi base.ldif
# create new
# change to your own suffix for the field [dc=srv,dc=world]

dn: ou=people,dc=srv,dc=world
objectClass: organizationalUnit
ou: people

dn: ou=groups,dc=srv,dc=world
objectClass: organizationalUnit
ou: groups

root@dlp:~#
ldapadd -x -D cn=admin,dc=srv,dc=world -W -f base.ldif

Enter LDAP Password:    
# LDAP admin password (set in installation of openldap)

adding new entry "ou=people,dc=srv,dc=world"

adding new entry "ou=groups,dc=srv,dc=world"
[3] If UFW is enabled, allow LDAP service.
root@dlp:~#
ufw allow ldap

root@dlp:~#
ufw allow ldaps

Rule added
Rule added (v6)
Matched Content