On Fri, Sep 22, 2023 at 1:22 AM Ulf Volmer <u.volmer@u-v.de> wrote:
On 21.09.23 21:27, Kaushal Shriyan wrote:
> Is there a way to reset both openldap root and cn=admin password?


It depends if your are using classic slapd.conf or cn=config backend.


In the first case, just edit slapd.conf and look for rootdn and rootpw
in the database section.

Please use slappasswd to generate the password hash (if your not using
argon2)


If you are using cn=config, you have to search for olcRootDN and
olcRootPW in your database config, maybe

olcDatabase={1}mdb,cn=config. You have to create an ldif file and apply
it using


ldapmodify -Y EXTERNAL -H ldapi:/// -f file.ldif.


cat file.ldif

dn: olcDatabase={1}mdb,cn=config
changetype: modify
replace: olcRootPW
olcRootPW: <hash>


Best regards

Ulf


Thanks Ulf for the quick response and detailed explanation. Much appreciated. 

Best Regards,

Kaushal