2011/07/10

Solution for Invalid Credentials Problem of LDAP

The platform is Fedora 14, but it should also work on Ubuntu and other Linux distributions as well.

If you follow LDAP tutorials which told you to edit /etc/openldap/slapd.conf but find your Linux distributor only set up /etc/openldap/slapd.d/ , then perhaps you have the same issue as I do.

In my case, the symptom is: after setting up LDAP server, ldapsearch works fine, but ldapadd and ldapmodify responds with "ldap_bind: Invalid credentials (49)."

The solution is adding olcRootPW directive in /etc/openldap/slapd.d/cn=config/olcDatabase={1}bdb.ldif , just like you have done in /etc/openldap/slapd.conf .

You can safely delete or rename slapd.conf , which is useless if slapd.d presents.

After restarting LDAP server, ldapadd and ldapmodify should work now.