I'm looking for a way to create an empty LDAP dictionary with the rfc2307bis schema. On Debian when installing slapd or when reconfiguring with dpkg the nis schema is used by default. How do I remove it or replace it with rfc2307bis ? At initialization or after.


I managed to do it. I edited this file: /usr/share/slapd/slapd.init.ldif and replaced a line:

#include: file:///etc/ldap/schema/nis.ldif
include: file:///etc/ldap/schema/rfc2307bis.ldif

And I ran dpkg-reconfigure slapd.

  • Note that your modifications to /usr/share/slapd/slapd.init.ldif will be lost on any upgrade of the slapd package. Modifying package files (except conffiles) is not supported. – Ferenc Wágner Jun 12 '17 at 6:57
  • That's not a problem, that is just for the creation of the database – DBLouis Jun 13 '17 at 10:20

After initialization, list the loaded schemas:

# ldapsearch -LLL -Y external -H ldapi:/// -b cn=schema,cn=config -s one dn
dn: cn={2}nis,cn=schema,cn=config

Remove the NIS schema:

# ldapdelete -Y external -H ldapi:/// cn={2}nis,cn=schema,cn=config

Add the other one:

# ldapadd -Y external -H ldapi:/// -f /etc/ldap/schema/rfc2307bis.ldif
  • I just tried and I cannot remove the nis schema: - ldapdelete -Y external cn={2}nis,cn=schema,cn=config -> Unknown authentication method (-6) - ldapdelete -Y external -H ldapi:/// cn={2}nis,cn=schema,cn=config -> Server is unwilling to perform (53) – DBLouis Jun 13 '17 at 9:59
  • Right, I didn't remember correctly. There is some experimental delete support in the config database code (search for SLAP_CONFIG_DELETE). But it's inactive and probably neglected. Thus you can't remove a schema properly. You can remove directories under /etc/ldap/slapd.d/cn=config/cn=schema after stopping slapd, but that's unsupported. – Ferenc Wágner Jun 13 '17 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.