Sometimes we need to delete the entire LDAP tree so as to add new users or to populate that with different information. While same can be achieved using ldapadd/ldapmodify commands, it can be quite painful if the tree becomes quite complex. Better way is to just delete the contents of LDAP tree & we can then populate with desired users/details. Below is how to get it done.
- Stop slapd service.
- Delete the contents of /var/lib/ldap/
- Start slapd service.
- Populate using ldapadd command. See the tutorials on setting up LDAP Server & Client here.