Linux 在Debian 8.x上使用nslcd进行LDAP用户身份验证

Linux 在Debian 8.x上使用nslcd进行LDAP用户身份验证,linux,active-directory,ldap,debian,Linux,Active Directory,Ldap,Debian,我在Debian 8.5中安装了包libpam ldapd,然后继续使用以下配置配置文件/etc/nslcd.conf: 问题是,当使用登录服务器时user@myorg.com我有以下日志(auth successfull,但由于@myorg.com部分,搜索失败,并且它使用了nslcd\u pam\u authc()函数): nslcd:[8e1f29]调试:ldap\u初始化(ldap://172.17.192.100) nslcd:[8e1f29]调试:ldap\u set\u reb

我在Debian 8.5中安装了包libpam ldapd,然后继续使用以下配置配置文件/etc/nslcd.conf



问题是,当使用登录服务器时user@myorg.com我有以下日志(auth successfull,但由于@myorg.com部分,搜索失败,并且它使用了nslcd\u pam\u authc()函数):

nslcd:[8e1f29]调试:ldap\u初始化(ldap://172.17.192.100)
nslcd:[8e1f29]调试:ldap\u set\u rebind\u proc()
nslcd:[8e1f29]调试:ldap_设置_选项(ldap_选项_协议_版本,3)
nslcd:[8e1f29]调试:ldap\u设置\u选项(ldap\u选项\u删除,0)
nslcd:[8e1f29]调试:ldap\u设置\u选项(ldap\u选项\u时间限制,0)
nslcd:[8e1f29]调试:ldap\u设置\u选项(ldap\u选项\u超时,0)
nslcd:[8e1f29]调试:ldap\u设置\u选项(ldap\u选项\u网络\u超时,0)
nslcd:[8e1f29]调试:ldap_设置_选项(ldap_选择_引用,ldap_选择_打开)
nslcd:[8e1f29]调试:ldap设置选项(ldap选择重新启动,ldap选择打开)
nslcd:[8e1f29]调试:ldap\u simple\u bind\s(“CN=isldap,DC=TI,DC=ads”,“***”)(uri=”ldap://172.17.192.100")
nslcd:[8e1f29]调试:ldap_result():结果结束(总共0个)
nslcd:[8e1f29]调试:myldap_搜索(base=“DC=myorg,DC=com”,filter=“(&(objectClass=person)(sAMAccountName=user@myorg.com))")
nslcd:[8e1f29]调试:ldap_result():结果结束(总共0个)
nslcd:[e87ccd]调试:来自pid=9046 uid=0 gid=0的连接
nslcd:[e87ccd]调试:nslcd_pam_authc(“user@myorg.com“,”sshd“,”***“)
nslcd:[e87ccd]调试:myldap_搜索(base=“DC=myorg,DC=com”,filter=“(&(objectClass=person)(sAMAccountName=user@myorg.com))")
nslcd:[e87ccd]调试:ldap_result():结果结束(共0个)
nslcd:[e87ccd]调试:myldap_搜索(base=“DC=myorg,DC=com”,filter=“(&(objectClass=person)(sAMAccountName=user@myorg.com))")
nslcd:[e87ccd]调试:ldap_result():结果结束(共0个)
nslcd:[e87ccd]调试:user@myorg.com“:找不到用户:没有此类对象

如果仅使用用户登录,则搜索成功,但身份验证未成功。(尝试使用完整DN和ldap_sasl_bind()函数进行身份验证)

nslcd:[8b4567]调试:ldap\u simple\u bind\s(“CN=ldapuserDC=myorg,DC=com”,“***”)(uri=”ldap://172.17.192.100")
nslcd:[8b4567]调试:ldap_结果():结果结束(共0个)
nslcd:[8b4567]调试:myldap_搜索(base=“OU=危地马拉支持团队,OU=TI_服务_账户,DC=TI,DC=ads”,filter=“(&(objectClass=ipHost)(ipHostNumber=10.0.2.2)))
nslcd:[8b4567]调试:ldap_结果():结果结束(共0个)
nslcd:[7b23c6]调试:来自pid=9099 uid=0 gid=0的连接
nslcd:[7b23c6]调试:myldap_搜索(base=“DC=myorg,DC=com”,filter=“(&(objectClass=person)(sAMAccountName=user)))
nslcd:[7b23c6]调试:ldap_初始化(ldap://172.17.192.100)
nslcd:[7b23c6]调试:ldap_set_rebind_proc()
nslcd:[7b23c6]调试:ldap\u simple\u bind\s(“CN=ldapuser,DC=myorg,DC=com”,“***”)(uri=”ldap://172.17.192.100")
nslcd:[7b23c6]调试:ldap_result():CN=User John Doe,DC=myorg,DC=com
nslcd:[7b23c6]CN=User John Doe,DC=myorg,DC=com:objectSid:missing
nslcd:[7b23c6]调试:ldap_结果():结果结束(共1个)
nslcd:[7b23c6]调试:myldap_搜索(base=“OU=危地马拉支持团队,OU=TI_服务_账户,DC=TI,DC=ads”,filter=“(&(objectClass=person)(sAMAccountName=user)))
nslcd:[7b23c6]调试:ldap_结果():结果结束(共0个)
nslcd:[3c9869]调试:来自pid=9099 uid=0 gid=0的连接
nslcd:[3c9869]调试:myldap_搜索(base=“DC=myorg,DC=com”,filter=“(&(objectClass=person)(sAMAccountName=user)))
nslcd:[3c9869]调试:ldap_result():CN=User John Doe,DC=myorg,DC=com
nslcd:[3c9869]CN=User John Doe,DC=myorg,DC=com:objectSid:missing
nslcd:[3c9869]调试:ldap_result():结果结束(共1个)
nslcd:[3c9869]调试:myldap_搜索(base=“OU=危地马拉支持团队,OU=TI_服务_账户,DC=TI,DC=ads”,filter=“(&(objectClass=person)(sAMAccountName=user)))
nslcd:[3c9869]调试:ldap_result():结果结束(总共0个)
nslcd:[334873]调试:来自pid=9099 uid=0 gid=0的连接
nslcd:[334873]调试:myldap_搜索(base=“DC=myorg,DC=com”,filter=“(&(objectClass=person)(sAMAccountName=user)))
nslcd:[334873]调试:ldap_result():CN=User John Doe,DC=myorg,DC=com
nslcd:[334873]CN=User John Doe,DC=myorg,DC=com:objectSid:missing
nslcd:[334873]调试:ldap_result():结果结束(共1个)
nslcd:[334873]调试:myldap_搜索(base=“OU=危地马拉支持团队,OU=TI_服务_账户,DC=TI,DC=ads”,filter=“(&(objectClass=person)(sAMAccountName=user)))
nslcd:[334873]调试:ldap_result():结果结束(总共0个)
nslcd:[b0dc51]调试:来自pid=9099 uid=0 gid=0的连接
nslcd:[b0dc51]调试:nslcd\u pam\u authc(“用户”、“sshd”、“***”)
nslcd:[b0dc51]调试:myldap_搜索(base=“DC=myorg,DC=com”,filter=“(&(objectClass=person)(sAMAccountName=user)))
nslcd:[b0dc51]调试:ldap\u初始化(ldap://172.17.192.100)
nslcd:[b0dc51]调试:ldap\u set\u rebind\u proc()
nslcd:[b0dc51]调试:ldap\u simple\u bind\s(“CN=ldapuserDC=myorg,DC=com”,“***”)(uri=”ldap://172.17.192.100")
nslcd:[b0dc51]调试:ldap_result():CN=User John Doe,DC=myorg,DC=com
nslcd:[b0dc51]调试:myldap_搜索(base=“CN=User John Doe,DC=myorg,DC=com”,filter=“(objectClass=*)”)
nslcd:[b0dc51]调试:ldap\u初始化(ldap://172.17.192.100)
nslcd:[b0dc51]调试:ldap\u set\u rebind\u proc()
nslcd:[b0dc51]调试:ldap\u sasl\u绑定(“CN=User John Doe,DC=myorg,DC=com”,“***”)(uri=”ldap://172.17.192.100")
nslcd:[b0dc51]调试:ldap_parse_result()结果:无效凭据:80090308:LDAPPER:DSID-0C09003D0,注释:AcceptSecurityContext错误,数据52e,v2580
nslcd:[b0dc51]调试:无法绑定到LDAP服务器ldap://172.17.192.100: 无效凭据:80090308:LdapErr:DSID-0C0903D0,注释:AcceptSecurityContext错误,数据52e,v2580
nslcd:[b0dc51]调试:ldap_unbind()
nslcd:[b0dc51]CN=User John Doe,DC=myorg,DC=com:凭据无效
nslcd:[b0dc51]调试:myldap_搜索(base=“DC=myorg,DC=com”,过滤器=”
# /etc/nslcd.conf
# nslc

d configuration file. See nslcd.conf(5)
# for details.

# The user and group nslcd should run as.
uid nslcd
gid nslcd

# The location at which the LDAP server(s) should be reachable.
uri ldap://172.17.192.100

# The search base that will be used for all queries.
base DC=myorg,DC=com

# The LDAP protocol version to use.
ldap_version 3

binddn CN=ldapuser,DC=myorg,DC=com
bindpw secret

# The search scope.
#scope sub
filter passwd (objectClass=person)
map    passwd uid              sAMAccountName
map    passwd uidNumber        employeeID
map    passwd gidNumber        objectSid

filter shadow (objectClass=person)
map    shadow uid              sAMAccountName
nslcd: [8e1f29] <passwd="user@myorg.com"> DEBUG: ldap_initialize(ldap://172.17.192.100)
nslcd: [8e1f29] <passwd="user@myorg.com"> DEBUG: ldap_set_rebind_proc()
nslcd: [8e1f29] <passwd="user@myorg.com"> DEBUG: ldap_set_option(LDAP_OPT_PROTOCOL_VERSION,3)
nslcd: [8e1f29] <passwd="user@myorg.com"> DEBUG: ldap_set_option(LDAP_OPT_DEREF,0)
nslcd: [8e1f29] <passwd="user@myorg.com"> DEBUG: ldap_set_option(LDAP_OPT_TIMELIMIT,0)
nslcd: [8e1f29] <passwd="user@myorg.com"> DEBUG: ldap_set_option(LDAP_OPT_TIMEOUT,0)
nslcd: [8e1f29] <passwd="user@myorg.com"> DEBUG: ldap_set_option(LDAP_OPT_NETWORK_TIMEOUT,0)
nslcd: [8e1f29] <passwd="user@myorg.com"> DEBUG: ldap_set_option(LDAP_OPT_REFERRALS,LDAP_OPT_ON)
nslcd: [8e1f29] <passwd="user@myorg.com"> DEBUG: ldap_set_option(LDAP_OPT_RESTART,LDAP_OPT_ON)
nslcd: [8e1f29] <passwd="user@myorg.com"> DEBUG: ldap_simple_bind_s("CN=isldap,DC=TI,DC=ads","***") (uri="ldap://172.17.192.100")
nslcd: [8e1f29] <passwd="user@myorg.com"> DEBUG: ldap_result(): end of results (0 total)
nslcd: [8e1f29] <passwd="user@myorg.com"> DEBUG: myldap_search(base="DC=myorg,DC=com", filter="(&(objectClass=person)(sAMAccountName=user@myorg.com))")
nslcd: [8e1f29] <passwd="user@myorg.com"> DEBUG: ldap_result(): end of results (0 total)
nslcd: [e87ccd] DEBUG: connection from pid=9046 uid=0 gid=0
nslcd: [e87ccd] <authc="user@myorg.com"> DEBUG: nslcd_pam_authc("user@myorg.com","sshd","***")
nslcd: [e87ccd] <authc="user@myorg.com"> DEBUG: myldap_search(base="DC=myorg,DC=com", filter="(&(objectClass=person)(sAMAccountName=user@myorg.com))")
nslcd: [e87ccd] <authc="user@myorg.com"> DEBUG: ldap_result(): end of results (0 total)
nslcd: [e87ccd] <authc="user@myorg.com"> DEBUG: myldap_search(base="DC=myorg,DC=com", filter="(&(objectClass=person)(sAMAccountName=user@myorg.com))")
nslcd: [e87ccd] <authc="user@myorg.com"> DEBUG: ldap_result(): end of results (0 total)
nslcd: [e87ccd] <authc="user@myorg.com"> DEBUG: "user@myorg.com": user not found: No such object
nslcd: [8b4567] <host=10.0.2.2> DEBUG: ldap_simple_bind_s("CN=ldapuserDC=myorg,DC=com","***") (uri="ldap://172.17.192.100")
nslcd: [8b4567] <host=10.0.2.2> DEBUG: ldap_result(): end of results (0 total)
nslcd: [8b4567] <host=10.0.2.2> DEBUG: myldap_search(base="OU=Guatemala Support Team,OU=TI_Service_Accounts,DC=TI,DC=ads", filter="(&(objectClass=ipHost)(ipHostNumber=10.0.2.2))")
nslcd: [8b4567] <host=10.0.2.2> DEBUG: ldap_result(): end of results (0 total)
nslcd: [7b23c6] DEBUG: connection from pid=9099 uid=0 gid=0
nslcd: [7b23c6] <passwd="user"> DEBUG: myldap_search(base="DC=myorg,DC=com", filter="(&(objectClass=person)(sAMAccountName=user))")
nslcd: [7b23c6] <passwd="user"> DEBUG: ldap_initialize(ldap://172.17.192.100)
nslcd: [7b23c6] <passwd="user"> DEBUG: ldap_set_rebind_proc()
nslcd: [7b23c6] <passwd="user"> DEBUG: ldap_simple_bind_s("CN=ldapuser,DC=myorg,DC=com","***") (uri="ldap://172.17.192.100")
nslcd: [7b23c6] <passwd="user"> DEBUG: ldap_result(): CN=User John Doe,DC=myorg,DC=com
nslcd: [7b23c6] <passwd="user"> CN=User John Doe,DC=myorg,DC=com: objectSid: missing
nslcd: [7b23c6] <passwd="user"> DEBUG: ldap_result(): end of results (1 total)
nslcd: [7b23c6] <passwd="user"> DEBUG: myldap_search(base="OU=Guatemala Support Team,OU=TI_Service_Accounts,DC=TI,DC=ads", filter="(&(objectClass=person)(sAMAccountName=user))")
nslcd: [7b23c6] <passwd="user"> DEBUG: ldap_result(): end of results (0 total)
nslcd: [3c9869] DEBUG: connection from pid=9099 uid=0 gid=0
nslcd: [3c9869] <passwd="user"> DEBUG: myldap_search(base="DC=myorg,DC=com", filter="(&(objectClass=person)(sAMAccountName=user))")
nslcd: [3c9869] <passwd="user"> DEBUG: ldap_result(): CN=User John Doe,DC=myorg,DC=com
nslcd: [3c9869] <passwd="user"> CN=User John Doe,DC=myorg,DC=com: objectSid: missing
nslcd: [3c9869] <passwd="user"> DEBUG: ldap_result(): end of results (1 total)
nslcd: [3c9869] <passwd="user"> DEBUG: myldap_search(base="OU=Guatemala Support Team,OU=TI_Service_Accounts,DC=TI,DC=ads", filter="(&(objectClass=person)(sAMAccountName=user))")
nslcd: [3c9869] <passwd="user"> DEBUG: ldap_result(): end of results (0 total)
nslcd: [334873] DEBUG: connection from pid=9099 uid=0 gid=0
nslcd: [334873] <passwd="user"> DEBUG: myldap_search(base="DC=myorg,DC=com", filter="(&(objectClass=person)(sAMAccountName=user))")
nslcd: [334873] <passwd="user"> DEBUG: ldap_result(): CN=User John Doe,DC=myorg,DC=com
nslcd: [334873] <passwd="user"> CN=User John Doe,DC=myorg,DC=com: objectSid: missing
nslcd: [334873] <passwd="user"> DEBUG: ldap_result(): end of results (1 total)
nslcd: [334873] <passwd="user"> DEBUG: myldap_search(base="OU=Guatemala Support Team,OU=TI_Service_Accounts,DC=TI,DC=ads", filter="(&(objectClass=person)(sAMAccountName=user))")
nslcd: [334873] <passwd="user"> DEBUG: ldap_result(): end of results (0 total)
nslcd: [b0dc51] DEBUG: connection from pid=9099 uid=0 gid=0
nslcd: [b0dc51] <authc="user"> DEBUG: nslcd_pam_authc("user","sshd","***")
nslcd: [b0dc51] <authc="user"> DEBUG: myldap_search(base="DC=myorg,DC=com", filter="(&(objectClass=person)(sAMAccountName=user))")
nslcd: [b0dc51] <authc="user"> DEBUG: ldap_initialize(ldap://172.17.192.100)
nslcd: [b0dc51] <authc="user"> DEBUG: ldap_set_rebind_proc()
nslcd: [b0dc51] <authc="user"> DEBUG: ldap_simple_bind_s("CN=ldapuserDC=myorg,DC=com","***") (uri="ldap://172.17.192.100")
nslcd: [b0dc51] <authc="user"> DEBUG: ldap_result(): CN=User John Doe,DC=myorg,DC=com
nslcd: [b0dc51] <authc="user"> DEBUG: myldap_search(base="CN=User John Doe,DC=myorg,DC=com", filter="(objectClass=*)")
nslcd: [b0dc51] <authc="user"> DEBUG: ldap_initialize(ldap://172.17.192.100)
nslcd: [b0dc51] <authc="user"> DEBUG: ldap_set_rebind_proc()
nslcd: [b0dc51] <authc="user"> DEBUG: ldap_sasl_bind("CN=User John Doe,DC=myorg,DC=com","***") (uri="ldap://172.17.192.100")
nslcd: [b0dc51] <authc="user"> DEBUG: ldap_parse_result() result: Invalid credentials: 80090308: LdapErr: DSID-0C0903D0, comment: AcceptSecurityContext error, data 52e, v2580
nslcd: [b0dc51] <authc="user"> DEBUG: failed to bind to LDAP server ldap://172.17.192.100: Invalid credentials: 80090308: LdapErr: DSID-0C0903D0, comment: AcceptSecurityContext error, data 52e, v2580
nslcd: [b0dc51] <authc="user"> DEBUG: ldap_unbind()
nslcd: [b0dc51] <authc="user"> CN=User John Doe,DC=myorg,DC=com: Invalid credentials
nslcd: [b0dc51] <authc="user"> DEBUG: myldap_search(base="DC=myorg,DC=com", filter="(&(objectClass=person)(sAMAccountName=user))")
nslcd: [b0dc51] <authc="user"> DEBUG: ldap_result(): CN=User John Doe,DC=myorg,DC=com
(&(objectCategory=person)(objectClass=user))