无法从Linux主机使用Kerberos查询AD

ldapsearch -H <URL> -b <BASE> -s sub -D <USER> -x -w <PW> 

工作正常

 kinit <USER>@<REALM> ldapsearch -H <URL> -b <BASE> -s sub 

失败:

 text: 000004DC: LdapErr: DSID-0C0906E8, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v1db1 kinit Administrator@<REALM> ldapsearch -H <URL> -b <BASE> -s sub 

也正常工作

通常的谷歌search没有显示任何有趣的事情。 (关于时间偏差和使用userPrincipalName与组件名称的-D ,通常有一些评论,但在使用kinit时应该注意这一点。)

有任何想法吗?

我发现在ldapsearch命令行上指定“-O maxssf = 0”是必要的,以便GSSAPI ADsearch能够正常工作。 以下命令适用于通过SSL连接searchAD全局编录:

 ldapsearch -LLL -O maxssf=0 -Y GSSAPI -H ldaps://ad.realm.local:3269 -b "dc=realm,dc=local" '(sAMAccountName=userid)' 

此外,为了使Kerberos身份validation与ldapsearch一起使用,必须正确configurationDNS以进行反向IP查找。 如果没有,你会得到一个“不能确定数字主机地址领域”的错误。 如有必要,您可以将AD服务器的IP和主机名放在hosts文件中以使其工作。

ldapsearch(1)页:

 -Y mech Specify the SASL mechanism to be used for authentication. If it's not specified, the program will choose the best mechanism the server knows. 

例如:

 ldapsearch -Y GSSAPI -b "dc=example,dc=com" uid=user 

假设你的/etc/gssapi_mech.conf如下所示:

 # grep -v ^# /etc/gssapi_mech.conf libgssapi_krb5.so.2 mechglue_internal_krb5_init