1

当我在 Centos 中测试以下命令时

ldapsearch -v -d5 ldaps://192.168.0.254 -D "cn=xuqifeng" -w 'xuqifeng'

系统告诉我:</p>

ldap_initialize( <DEFAULT> )
ldap_create
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP localhost:389
ldap_new_socket: 3
ldap_prepare_socket: 3
ldap_connect_to_host: Trying ::1 389
ldap_pvt_connect: fd: 3 tm: -1 async: 0
ldap_close_socket: 3
ldap_new_socket: 3
ldap_prepare_socket: 3
ldap_connect_to_host: Trying 127.0.0.1:389
ldap_pvt_connect: fd: 3 tm: -1 async: 0
ldap_close_socket: 3
ldap_err2string
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

OMG,Help.ps:主机ip为192.168.0.254的系统是Microsoft Server 2003。

4

1 回答 1

2

您没有向 ldapsearch 提供正确的主机参数。使用 -H 来实现

ldapsearch -v -d5 -H ldaps://192.168.0.254 -D "cn=xuqifeng" -w 'xuqifeng'

但这与python无关

于 2012-10-22T08:47:44.920 回答