可以加入域,但ldapsearch失败

时间:2015-04-13 11:43:16

标签: php active-directory ldap

我可以使用此命令成功通过Centrify DirectControl Express将Ubuntu 12.04加入Active Directory服务器(Windows Server 2008 R2):

sudo adjoin beh-domain.com

同时,此命令失败:

ldapsearch -x -v -W -h 10.25.25.46

ip属于服务器。我无法弄清楚为什么。它失败了这条消息:

ldap_initialize( ldap://10.25.25.46 )
filter: (objectclass=*)
requesting: All userApplication attributes
# extended LDIF
#
# LDAPv3
# base <> (default) with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2
result: 1 Operations error
text: 000004DC: LdapErr: DSID-0C0906E8, comment: In order to perform this ope
 ration a successful bind must be completed on the connection., data 0, v1db1

# numResponses: 1

如果我不使用-x选项,则失败并显示:

ldap_initialize( ldap://10.25.25.46 )
SASL/EXTERNAL authentication started
ldap_sasl_interactive_bind_s: Unknown authentication method (-6)
    additional info: SASL(-4): no mechanism available: 

我的最终目标是使用PHP Web服务内部的AD服务器对用户进行身份验证。

1 个答案:

答案 0 :(得分:0)

默认情况下,2008R2不允许匿名绑定,因此您需要使用AD帐户来执行ldapsearch。

你可以

  1. 使用简单身份验证并使用-D:
  2. 定义您的AD帐户

    e.g。

    ldapsearch -x -D testuser@domain.com -W -v -h

    1. 使用Centrify提供的ldapsearch并与用户kerberos ticket绑定:
    2. / usr / share / centrifydc / bin / ldapsearch -v -h

      e.g。

      [testmac @ centos~] $ klist 票证缓存:文件:/ tmp / krb5cc_1623196924 默认主体:testmac@SUPPORT.DOMAIN

      有效启动Expires服务主体 04/15/15 13:23:51 04/15/15 23:23:50 krbtgt/SUPPORT.DOMAIN@SUPPORT.DOMAIN     续约至2015年4月22日13:23:51

      [testmac @ centos~] $ / usr / share / centrifydc / bin / ldapsearch -v -h 192.168.3.21

      SASL / GSSAPI身份验证已启动 ..

      搜索结果 搜索:4 结果:0成功

      1. 以root身份运行并使用Centrify ldapsearch提供的计算机凭据选项:
      2. sudo / usr / share / centrifydc / bin / ldapsearch -m -v -h

        e.g。

        [root @ centos~]#/ usr / share / centrifydc / bin / ldapsearch -m -v -h 192.168.3.21

        使用默认计算机凭据缓存进行身份验证!SASL / GSSAPI ..

        搜索结果 搜索:4 结果:0成功

相关问题