Php 可以加入域,但ldapsearch失败

Php 可以加入域,但ldapsearch失败,php,active-directory,ldap,Php,Active Directory,Ldap,我可以使用以下命令成功地将Ubuntu 12.04加入Active Directory服务器(Windows server 2008 R2),方法是将DirectControl Express设置为中心: sudo adjoin beh-domain.com 同时,此命令失败: ldapsearch -x -v -W -h 10.25.25.46 ip属于服务器。我不明白为什么。它将失败,并显示以下消息: ldap_initialize( ldap://10.25.25.46 ) filte

我可以使用以下命令成功地将Ubuntu 12.04加入Active Directory服务器(Windows server 2008 R2),方法是将DirectControl Express设置为中心:

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

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

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

你也可以

  • 使用简单身份验证并使用-D定义您的广告帐户:
  • e、 g

    ldapsearch-x-Dtestuser@domain.com-W-v-h

  • 使用Centrify提供的ldapsearch并与用户kerberos票证绑定:
  • /usr/share/centrifydc/bin/ldapsearch-v-h

    e、 g

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

    有效的启动过期服务主体 04/15/15 13:23:51 04/15/15 23:23:50 krbtgt/支架。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成功

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

    e、 g

    [root@centos~]#/usr/share/centrifydc/bin/ldapsearch-m-v-h192.168.3.21

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

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

    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: