How can I remove my OpenLdap entry?

Issues related to configuring your network
Post Reply
hack3rcon
Posts: 757
Joined: 2014/11/24 11:04:37

How can I remove my OpenLdap entry?

Post by hack3rcon » 2015/08/21 10:35:20

Hello.
I added some users to Openldap and I want to remove them but I can't. I reinstall openldap too but problem not solved :(

[root@localhost openldap]# slapcat
55d6feeb ldif_read_file: checksum error on "/etc/openldap/slapd.d/cn=config/olcDatabase={1}monitor.ldif"
55d6feeb ldif_read_file: checksum error on "/etc/openldap/slapd.d/cn=config/olcDatabase={2}hdb.ldif"
55d6feeb The first database does not allow slapcat; using the first available one (2)
55d6feeb hdb_db_open: warning - no DB_CONFIG file found in directory /var/lib/ldap: (2).
Expect poor performance for suffix "dc=linux,dc=dj".
dn: dc=linux-d,dc=j
objectClass: dcObject
objectClass: organization
dc: linux-d
o: linux-d
structuralObjectClass: organization
entryUUID: 1c4fa7b0-da8c-1034-91a3-f90dc6355c19
creatorsName: cn=Manager,dc=linux-d,dc=j
createTimestamp: 20150819070316Z
entryCSN: 20150819070316.921292Z#000000#000#000000
modifiersName: cn=Manager,dc=linux-d,dc=j
modifyTimestamp: 20150819070316Z

dn: ou=Users,dc=linux-d,dc=j
objectClass: organizationalUnit
ou: Users
structuralObjectClass: organizationalUnit
entryUUID: c3dbe28c-da8c-1034-91a4-f90dc6355c19
creatorsName: cn=Manager,dc=linux-d,dc=j
createTimestamp: 20150819070758Z
entryCSN: 20150819070758.019816Z#000000#000#000000
modifiersName: cn=Manager,dc=linux-d,dc=j
modifyTimestamp: 20150819070758Z

I want to change all "linux-d" to "linux".

Thank you.

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: How can I remove my OpenLdap entry?

Post by aks » 2015/08/22 13:52:10

Changing the BaseDN is a bit of a big deal.
1) Export the old LDAP database to ldif file (slapcat should work).
2) Delete the old databases.
3) Create a new LDAP database with new domain name.
4) Modify the exported ldif file above to fit the new domain (the root dn) - (could use sed for this).
5) Import the modified ldif file into the new database
It's really, get rid of it and start again but using LDIF to backup and restore.

Post Reply