Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issues logging in ldap root DN

Tags:

openldap

I almost been stuck a day on the following issue,

I installed LDAP using: apt-get install slapd

and use the following configuration:

include     /etc/openldap/schema/core.schema
include     /etc/openldap/schema/cosine.schema
include     /etc/openldap/schema/inetorgperson.schema
include     /etc/openldap/schema/nis.schema


allow bind_v2
loglevel    0
moduleload  back_sbdb.la

database    bdb
suffix      "dc=test,dc=nl"
rootdn      "cn=Directory Manager,dc=test,dc=nl"
rootpw      test

directory   /var/lib/ldap

index   objectClass                     eq
index   userPassword                        eq,pres
index   givenName,mail,mobile,sn,title,cn,description       eq,sub,pres
index   displayName                     eq,sub,pres
index   postalAddress,facsimileTelephoneNumber          pres

access to *
  by self write
  by * read

and I then try to bind using

ldapsearch -D cn=Directory Manager,dc=test,dc=nl -w test

but I still recieve the error ldap_bind: Invalid Credentials (49)

Anyone has any idea or clues what this could be?

Thanks in forward

like image 513
Tjirp Avatar asked Nov 04 '22 10:11

Tjirp


1 Answers

Try it using quotes like;

ldapsearch -D "cn=Directory Manager,dc=test,dc=nl" -w test

Space character in Directory Manager may cause the problem.

Edit: Also, are you sure you don't need -h -p parameters?

-h     The host name of the directory server
-p     The port number of the directory server

Edit2: Just figured out what is wrong. You are using rootpw unencrypted in your slapd config file. You should use an encrypted password created by slappasswd tools output. This may cause problems under special circumstances.

Check this link for details: http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-ldap-quickstart.html

like image 189
Emir Akaydın Avatar answered Nov 28 '22 20:11

Emir Akaydın