openLDAP : Issues & Solutions

Fathima Dilhasha
‘How to’ Guides by Dilhasha
1 min readApr 28, 2017

You can refer to my stories Install openLDAP in ubuntu, OpenLDAP — Import DIT with data for more details on openLDAP.

Below are 2 issues I faced and how I overcame them.

Issue 1:

Syntax error while trying to add a new entry
ldap_add: Invalid syntax (21)
additional info: objectClass: value #0 invalid per syntax

Reason : According to the description, it cannot identify a specified objectClass. This can be because the required schema is not added to openLDAP before trying to add entries which refer to custom objectClasses or attributes.

Refer this serverfault issue for an example.

Issue 2:

Let’s say you are trying to use ldapadd to add some custom LDIF.

sudo ldapadd -x -D “cn=Manager,dc=example,dc=com” -W -f /etc/ldap/mytree.ldif
Enter LDAP Password:
ldap_bind: Invalid credentials (49)

One possible reason for this issue is that slapd is expecting an encrytpted password while your password is not actually encrypted.

find “rootpw” in slapd.conf and then encrypt it using the below command and replace it. Assume rootpw is “secret” .

slappasswd -h {SHA} -s secret

encrypting password is “{SHA}5en6G6MezRroT3XKqkdPOmY/BfQ=”

Make sure to restart the openLDAP server for this change to take effect. You can see a detailed example at this SO question.

Please feel free to comment any other issues you’ve faced and how you solved them. :)

--

--