Authentication nslcd查找失败:未返回任何结果

Authentication nslcd查找失败:未返回任何结果,authentication,ldap,Authentication,Ldap,我想用LDAP目录验证我的用户。 我已将nslcd配置为执行此操作,但它失败了。 nslcd调试模式表明: nslcd:[b0dc51]调试: ldap\u simple\u bind\s(“uid=seb,ou=Users,dc=unix,dc=chhavre,dc=fr”,“***”) (uri=”ldap://net.ch-havre.fr)nslcd:[b0dc51]调试: ldap_result():结果结束(共0个)nslcd:[b0dc51] uid=seb,ou=Users,dc

我想用LDAP目录验证我的用户。 我已将nslcd配置为执行此操作,但它失败了。 nslcd调试模式表明:

nslcd:[b0dc51]调试: ldap\u simple\u bind\s(“uid=seb,ou=Users,dc=unix,dc=chhavre,dc=fr”,“***”) (uri=”ldap://net.ch-havre.fr)nslcd:[b0dc51]调试: ldap_result():结果结束(共0个)nslcd:[b0dc51] uid=seb,ou=Users,dc=unix,dc=chhavre,dc=fr:查找失败:无结果 返回

getent passwd seb->OK getent shadow seb->OK

谢谢你的回答。 我的搜索库在nslcd.conf中定义为:

uid nslcd
gid ldap
ldap_version 3
binddn cn=UnixBind,dc=Unix,dc=ch-havre,dc=fr
bindpw XXXXXX
base   group  ou=Group,dc=unix,dc=ch-havre,dc=fr
base   passwd ou=Users,dc=unix,dc=ch-havre,dc=fr
base   shadow ou=Users,dc=unix,dc=ch-havre,dc=fr
ssl no
tls_cacertdir /etc/openldap/cacerts
uri ldap://net.ch-havre.fr
base dc=ch-havre,dc=fr
有什么不对劲吗

这是调试模式输出:

nslcd: [b71efb] DEBUG: connection from pid=20820 uid=0 gid=0
nslcd: [b71efb] <passwd="seb"> DEBUG: myldap_search(base="dc=unix,dc=ch-havre,dc=fr", filter="(&(objectClass=posixAccount)(uid=seb))")
nslcd: [b71efb] <passwd="seb"> DEBUG: ldap_result(): uid=seb,ou=Users,dc=unix,dc=ch-havre,dc=fr
nslcd: [b71efb] <passwd="seb"> DEBUG: ldap_result(): end of results (1 total)
nslcd: [e2a9e3] DEBUG: connection from pid=20820 uid=0 gid=0
nslcd: [e2a9e3] <passwd="seb"> DEBUG: myldap_search(base="dc=unix,dc=ch-havre,dc=fr", filter="(&(objectClass=posixAccount)(uid=seb))")
nslcd: [e2a9e3] <passwd="seb"> DEBUG: ldap_result(): uid=seb,ou=Users,dc=unix,dc=ch-havre,dc=fr
nslcd: [e2a9e3] <passwd="seb"> DEBUG: ldap_result(): end of results (1 total)
nslcd: [45e146] DEBUG: connection from pid=20820 uid=0 gid=0
nslcd: [45e146] <passwd="seb"> DEBUG: myldap_search(base="dc=unix,dc=ch-havre,dc=fr", filter="(&(objectClass=posixAccount)(uid=seb))")
nslcd: [45e146] <passwd="seb"> DEBUG: ldap_result(): uid=seb,ou=Users,dc=unix,dc=ch-havre,dc=fr
nslcd: [45e146] <passwd="seb"> DEBUG: ldap_result(): end of results (1 total)
nslcd: [5f007c] DEBUG: connection from pid=20820 uid=0 gid=0
nslcd: [5f007c] <passwd="seb"> DEBUG: myldap_search(base="dc=unix,dc=ch-havre,dc=fr", filter="(&(objectClass=posixAccount)(uid=seb))")
nslcd: [5f007c] <passwd="seb"> DEBUG: ldap_result(): uid=seb,ou=Users,dc=unix,dc=ch-havre,dc=fr
nslcd: [5f007c] <passwd="seb"> DEBUG: ldap_result(): end of results (1 total)
nslcd: [d062c2] DEBUG: connection from pid=20820 uid=0 gid=0
nslcd: [d062c2] <authc="seb"> DEBUG: nslcd_pam_authc("seb","sshd","***")
nslcd: [d062c2] <authc="seb"> DEBUG: myldap_search(base="dc=unix,dc=ch-havre,dc=fr", filter="(&(objectClass=posixAccount)(uid=seb))")
nslcd: [d062c2] <authc="seb"> DEBUG: ldap_result(): uid=seb,ou=Users,dc=unix,dc=ch-havre,dc=fr
nslcd: [d062c2] <authc="seb"> DEBUG: myldap_search(base="uid=seb,ou=Users,dc=unix,dc=ch-havre,dc=fr", filter="(objectClass=*)")
nslcd: [d062c2] <authc="seb"> DEBUG: ldap_initialize(ldap://net.ch-havre.fr)
nslcd: [d062c2] <authc="seb"> DEBUG: ldap_set_rebind_proc()
nslcd: [d062c2] <authc="seb"> DEBUG: ldap_set_option(LDAP_OPT_PROTOCOL_VERSION,3)
nslcd: [d062c2] <authc="seb"> DEBUG: ldap_set_option(LDAP_OPT_DEREF,0)
nslcd: [d062c2] <authc="seb"> DEBUG: ldap_set_option(LDAP_OPT_TIMELIMIT,0)
nslcd: [d062c2] <authc="seb"> DEBUG: ldap_set_option(LDAP_OPT_TIMEOUT,0)
nslcd: [d062c2] <authc="seb"> DEBUG: ldap_set_option(LDAP_OPT_NETWORK_TIMEOUT,0)
nslcd: [d062c2] <authc="seb"> DEBUG: ldap_set_option(LDAP_OPT_REFERRALS,LDAP_OPT_ON)
nslcd: [d062c2] <authc="seb"> DEBUG: ldap_set_option(LDAP_OPT_RESTART,LDAP_OPT_ON)
nslcd: [d062c2] <authc="seb"> DEBUG: ldap_simple_bind_s("uid=seb,ou=Users,dc=unix,dc=ch-havre,dc=fr","***") (uri="ldap://net.ch-havre.fr")
nslcd: [d062c2] <authc="seb"> DEBUG: ldap_result(): end of results (0 total)
nslcd: [d062c2] <authc="seb"> uid=seb,ou=Users,dc=unix,dc=ch-havre,dc=fr: lookup failed: No results returned
nslcd: [d062c2] <authc="seb"> DEBUG: ldap_unbind()
nslcd: [d062c2] <authc="seb"> DEBUG: myldap_search(base="dc=unix,dc=ch-havre,dc=fr", filter="(&(objectClass=shadowAccount)(uid=seb))")
nslcd: [d062c2] <authc="seb"> DEBUG: ldap_result(): uid=seb,ou=Users,dc=unix,dc=ch-havre,dc=fr
nslcd:[b71efb]调试:来自pid=20820 uid=0 gid=0的连接
nslcd:[b71efb]调试:myldap_搜索(base=“dc=unix,dc=chhavre,dc=fr”,filter=“(&(objectClass=posixAccount)(uid=seb)))
nslcd:[b71efb]调试:ldap_result():uid=seb,ou=Users,dc=unix,dc=chhavre,dc=fr
nslcd:[b71efb]调试:ldap_结果():结果结束(共1个)
nslcd:[e2a9e3]调试:来自pid=20820 uid=0 gid=0的连接
nslcd:[e2a9e3]调试:myldap_搜索(base=“dc=unix,dc=chhavre,dc=fr”,filter=“(&(objectClass=posixAccount)(uid=seb)))
nslcd:[e2a9e3]调试:ldap_result():uid=seb,ou=Users,dc=unix,dc=chhavre,dc=fr
nslcd:[e2a9e3]调试:ldap_结果():结果结束(共1个)
nslcd:[45e146]调试:来自pid=20820 uid=0 gid=0的连接
nslcd:[45e146]调试:myldap_搜索(base=“dc=unix,dc=chhavre,dc=fr”,filter=“(&(objectClass=posixAccount)(uid=seb)))
nslcd:[45e146]调试:ldap_result():uid=seb,ou=Users,dc=unix,dc=chhavre,dc=fr
nslcd:[45e146]调试:ldap_result():结果结束(共1个)
nslcd:[5f007c]调试:来自pid的连接=20820 uid=0 gid=0
nslcd:[5f007c]调试:myldap_搜索(base=“dc=unix,dc=chhavre,dc=fr”,filter=“(&(objectClass=posixAccount)(uid=seb)))
nslcd:[5f007c]调试:ldap_result():uid=seb,ou=Users,dc=unix,dc=chhavre,dc=fr
nslcd:[5f007c]调试:ldap_结果():结果结束(共1个)
nslcd:[d062c2]调试:来自pid=20820的连接uid=0 gid=0
nslcd:[d062c2]调试:nslcd\u pam\u authc(“seb”、“sshd”、“***”)
nslcd:[d062c2]调试:myldap_搜索(base=“dc=unix,dc=chhavre,dc=fr”,filter=“(&(objectClass=posixAccount)(uid=seb)))
nslcd:[d062c2]调试:ldap_result():uid=seb,ou=Users,dc=unix,dc=chhavre,dc=fr
nslcd:[d062c2]调试:myldap_搜索(base=“uid=seb,ou=Users,dc=unix,dc=chhavre,dc=fr”,filter=“(objectClass=*)”)
nslcd:[d062c2]调试:ldap\U初始化(ldap://net.ch-havre.fr)
nslcd:[d062c2]调试:ldap\u set\u rebind\u proc()
nslcd:[d062c2]调试:ldap_设置_选项(ldap_选项_协议_版本,3)
nslcd:[d062c2]调试:ldap\u设置\u选项(ldap\u选项\u删除,0)
nslcd:[d062c2]调试:ldap\u设置\u选项(ldap\u选项\u时间限制,0)
nslcd:[d062c2]调试:ldap\u设置\u选项(ldap\u选项\u超时,0)
nslcd:[d062c2]调试:ldap\u设置\u选项(ldap\u选项\u网络\u超时,0)
nslcd:[d062c2]调试:ldap_设置_选项(ldap_选择_引用,ldap_选择_打开)
nslcd:[d062c2]调试:ldap设置选项(ldap选择重新启动,ldap选择打开)
nslcd:[d062c2]调试:ldap\u simple\u bind\s(“uid=seb,ou=Users,dc=unix,dc=chhavre,dc=fr”,“***”)(uri=”ldap://net.ch-havre.fr")
nslcd:[d062c2]调试:ldap_结果():结果结束(共0个)
nslcd:[d062c2]uid=seb,ou=Users,dc=unix,dc=ch-havre,dc=fr:查找失败:未返回结果
nslcd:[d062c2]调试:ldap_unbind()
nslcd:[d062c2]调试:myldap_搜索(base=“dc=unix,dc=chhavre,dc=fr”,filter=“(&(objectClass=shadowAccount)(uid=seb)))
nslcd:[d062c2]调试:ldap_result():uid=seb,ou=Users,dc=unix,dc=chhavre,dc=fr

Sebastien

您的nslcd.conf中有什么?我建议您尝试使用一个全局搜索库(注释掉特定于地图的库),看看它是否有任何变化:
base dc=unix,dc=ch-havre,dc=fr
它也可以工作。我在问题中添加了调试模式输出。绑定和搜索库都可以,因为找到了“seb”条目,但是使用
ldap\u simple\u bind\u s()
的简单身份验证失败。因为我们知道seb条目的dn是正确的,所以您的问题可能来自其他地方。检查你的ACL。此外,我还看到了对
ldap\u set\u rebind\u proc()
的调用,因此您的应用程序似乎需要绑定到另一台服务器才能遵循引用或搜索继续引用,这真的需要吗?首先,我将尝试手动绑定seb的凭据,以查看它是否可以与引用一起使用。nslcd.conf中有什么内容?我建议您尝试使用一个全局搜索库(注释掉特定于映射的库),并查看它是否有任何更改:
base dc=unix,dc=ch havre,dc=fr
它也可以工作。我在问题中添加了调试模式输出。绑定和搜索库都可以,因为找到了“seb”条目,但是使用
ldap\u simple\u bind\s()进行简单身份验证失败。因为我们知道seb条目的dn是正确的,所以您的问题可能来自其他地方。检查你的ACL。此外,我还看到了对
ldap\u set\u rebind\u proc()
的调用,因此您的应用程序似乎需要绑定到另一台服务器才能遵循引用或搜索继续引用,这真的需要吗?首先,我将尝试手动绑定seb的凭据,以查看它是否可以使用/不使用引用。