Openldap with Red Hat 6: ldapadd ldap_bind: Invalid credentials (49)

Red Hat Enterprise 6OpenLDAP in Red Hat Enterprise 6 has changed its configuration. Users who configured OpenLDAP in Red Hat Enterprise 5 may wonder why commands such as ldapadd and ldapsearch report “ldapadd ldap_bind: Invalid credentials (49)” despite having configured it. This article explains how to resolve the problem. OpenLDAP in Red Hat Enterprise 6 stores its configuration files in /etc/openldap/slapd.d/ as a configuration tree. Looking inside can be confusing: what is it, and how do you configure it? We can convert the old configuration file (slapd.conf) into the new format stored in /etc/openldap/slapd.d/. The steps are:

  1. Remove all files in /etc/openldap/slapd.d/ with:

    [root@ezylinux ~]# rm -rf /etc/openldap/slapd.d/*
  2. Run slaptest to test the configuration file and generate the configuration in /etc/openldap/slapd.d/.

    [root@ezylinux ~]# slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d
  3. Set permissions for the new configuration files.

    [root@ezylinux ~]# chown -R ldap:ldap /etc/openldap/slapd.d
    [root@ezylinux ~]# chmod -R 000 /etc/openldap/slapd.d
    [root@ezylinux ~]# chmod -R u+rwX /etc/openldap/slapd.d
  4. Finally, delete or rename slapd.conf.

Once all steps are complete, try service slapd start, then use the service as needed. English version: Red Hat 6: How to fixes ldapadd ldap_bind: Invalid credentials (49)

EOF.← Back to articles