Install OpenLDAP.

[root@dlp ~]#

dnf -y install openldap-servers openldap-clients

[root@dlp ~]#

cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG

[root@dlp ~]#

chown ldap. /var/lib/ldap/DB_CONFIG

[root@dlp ~]#

systemctl start slapd

[root@dlp ~]#

systemctl enable slapd
[2] Set OpenLDAP admin password.
# generate encrypted password

[root@dlp ~]#

slappasswd

New password:
Re-enter new password:
{SSHA}xxxxxxxxxxxxxxxxxxxxxxxx

[root@dlp ~]#

vi chrootpw.ldif
# specify the password generated above for “olcRootPW” section
dn: olcDatabase={0}config,cn=config
changetype: modify
add: olcRootPW
olcRootPW: {SSHA}xxxxxxxxxxxxxxxxxxxxxxxx

[root@dlp ~]#

ldapadd -Y EXTERNAL -H ldapi:/// -f chrootpw.ldif

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry “olcDatabase={0}config,cn=config”

Leave a comment