note: to change things in OpenLDAP, create LDIF files with information about what you want to change. Do not edit the LDIF files in the /etc/ldap/slapd.d or /etc/openldap/slapd.d manually.
slappasswd
{SSHA}XXXXXXX
create ldif file -> run ldap command
nano rootpw.ldif
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcRootPW
olcRootPW: {SSHA}XXXXXXX
ldapadd -Y EXTERNAL -H ldapi:/// -f rootpw.ldif
nano remove_rootpw.ldif
dn: olcDatabase={1}mdb,cn=config
changetype: modify
delete: olcRootPW
ldapmodify -Y EXTERNAL -H ldapi:/// -f remove_rootpw.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/cosine.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/nis.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/openldap.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/dyngroup.ldif
nano manager.ldif
dn: olcDatabase={1}mdb,cn=config
changetype: modify
replace: olcSuffix
olcSuffix: dc=mycompany,dc=local
dn: olcDatabase={1}mdb,cn=config
changetype: modify
replace: olcRootDN
olcRootDN: cn=Manager,dc=mycompany,dc=local
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcRootPW
olcRootPW: {SSHA}XXXXXXX
ldapmodify -Y EXTERNAL -H ldapi:/// -f manager.ldif
nano org.ldif
dn: dc=mycompany,dc=local
objectClass: top
objectClass: dcObject
objectclass: organization
o: My LDAP Server
dc: mycompany
dn: cn=Manager,dc=mycompany,dc=local
objectClass: organizationalRole
cn: Manager
description: LDAP Manager
dn: ou=ldapusers,dc=mycompany,dc=local
objectClass: organizationalUnit
ou: ldapUsers
ldapadd -x -D cn=Manager,dc=mycompany,dc=local -W -f org.ldif
nano addUserName.ldif
dn: cn=User Name,dc=mycompany,dc=local
changetype: add
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
uid: subham
cn: Subham Sarangi
sn: subham
displayName: Subham Sarangi
mail: subham@yopmail.com
userPassword: {SSHA}pIfHfUUd1dLDvy3JJWINodLy0Fan+3zb
ldapadd -D "cn=Manager,dc=mycompany,dc=local" -W -f addUserName.ldif
nano modifyUserName.ldif
dn: cn=User Name,dc=mycompany,dc=local
changetype: modify
replace: cn
cn: New Name
ldapmodify -D "cn=Manager,dc=mycompany,dc=local" -W -f modifyUserName.ldif
ldapsearch -x -H ldap://localhost -b dc=mycompany,dc=local
ldapsearch -x -b "dc=mycompany,dc=local" "(objectclass=*)"
see example_result
ldapsearch -Y EXTERNAL -H ldapi:/// -b "cn=config" "(olcRootPW=*)"
https://ibm.com/docs/en/rpa/23.0?topic=ldap-installing-configuring-openldap