A
A
Artyom Brykin2018-06-05 11:28:12
OpenLDAP
Artyom Brykin, 2018-06-05 11:28:12

How to change CN=admin password in OpenLDAP via APACHE DIRECTORY STUDIO?

Can't change OpenLDAP password for CN=admin,DC=domain,DC=local via APACHE DIRECTORY STUDIO. More precisely, it changes (is added), but when I can connect to LDAP using the new password and the old one. I do everything according to this instruction:
directory.apache.org/apacheds/basic-ug/1.4.2-chang...
There is no access to the server itself, on which OpenLDAP is running.
How to be?
Thank you all in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom Brykin, 2018-06-15
@MindPhaser34

Perhaps I will answer myself. After much digging around the network, I still changed the password, now I’ll tell you how, for sure someone will need it. I’ll note right away that I didn’t manage to do this through the Apache directory studio snap-in, I had to go directly to the server via SSH. If someone succeeds, please share the solution.
So, to begin with, it is worth noting the following, that there are several administrative users in LDAP. One of them is from the LDAP configuration database (cn=admin,cn=config), it is located in the LDAP database (olcDatabase={1}hdb,cn=config). And the second is the domain administrator account (cn=admin,dc=domain,dc=local). In order to change the password, it is initially necessary to generate a hash of this password:
Generate a hash for the new password and upload it to the file:
/usr/sbin/slappasswd -h {SSHA} >> ~/newpasswd.ldif
SSHA = This is the encryption type. Next, edit the newpasswd.ldif file to change the password. Replace {SSHA}newhashsymbols with the generated hash.
dn: olcDatabase={1}hdb,cn=config
changetype: modify
replace: olcRootPW
olcRootPW: {SSHA}newhashsymbols....
Save, exit. To make changes, write:
ldapmodify -H ldapi:// -Y EXTERNAL -f ~/newpasswd.ldif
That's it, the password has been changed.
Similarly for the domain administrator account (cn=admin,dc=domain,dc=local). We generate a hash for the password, save it to a file (~/newpasswd.ldif), open it for editing:
dn: cn=admin,dc=domain,dc=local
changetype: modify
replace: userPassword
userPassword: {SSHA}newhassymbols
Apply changes:
ldapmodify -H ldap:// -x -D "cn=admin,dc=domain,dc=local" -W -f ~/newpasswd.ldif
Profit.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question