在以下问题上,我几乎一天都被困住了,

我使用以下命令安装了LDAP:apt-get install slapd

并使用以下配置:

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

然后我尝试使用绑定(bind)
ldapsearch -D cn=Directory Manager,dc=test,dc=nl -w test

但我仍然收到错误ldap_bind:无效的凭据(49)

任何人都有任何想法或线索可能是什么?

谢谢前进

最佳答案

尝试使用引号,例如;

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

目录管理器中的空格字符可能会导致此问题。

编辑:另外,您确定不需要-h -p参数吗?
-h     The host name of the directory server
-p     The port number of the directory server

Edit2:刚刚找出了什么地方出了问题。您正在使用slapd配置文件中未加密的rootpw。您应该使用slappasswd工具输出创建的加密密码。在特殊情况下,这可能会引起问题。

检查此链接以获取详细信息:http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-ldap-quickstart.html

关于openldap - 在ldap根DN中记录问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8258766/

10-11 22:32
查看更多