我在RHEL 5.4上设置了一个OpenLDAP服务器,并configuration其他服务器来对其进行身份validation。 我有两个StartdLS ldap和ldapsconfiguration和工作。
在我的客户端机器上,我的/etc/nsswitch.conf包含:
passwd: files ldap shadow: files ldap group: files ldap
我可以用一个只在LDAP中定义的用户成功login到一个客户端(也就是说,在/ etc / passwd中找不到它,并且成功地向LDAP请求用户信息,并通过存储在LDAP中的密码哈希进行身份validation)。
我的问题是,当我试图locking访问LDAP服务器中的属性时,特别是在/etc/openldap/slapd.conf中 ,ldap用户不能再login:
access to attrs=userpassword by self write by anonymous auth by * none
我loggingslapd,它出现(我的解释,纠正我,如果我错了),pam_ldap正试图读取 poxixAccount objectClass中的所有属性:
filter: (&(objectClass=posixAccount)(uid=cthompson)) attrs: uid userPassword uidNumber gidNumber cn homeDirectory loginShell gecos description objectClass
在我的openldap日志logging,我没有访问或acl错误,但我得到:
access_allowed: search access to "uid=cthompson,ou=People,dc=domain,dc=com" "objectClass" requested access_allowed: search access to "uid=cthompson,ou=People,dc=domain,dc=com" "uid" requested
有没有什么需要configuration,而不是阅读userPassword属性,pam_ldap试图“auth”反对它(所以请求得到由“匿名auth”访问规则处理?
pam_ldap不应该尝试读取userPassword值来login您 – 通过使用它检索的DN执行LDAP绑定来login您。
有可能pam_ldap使用的search参数过于宽泛,它会尝试拉取userPassword,但是如果您的ACL设置正确(对我来说看起来很好),它的结果将不会得到该值。
以防万一您的ACL 不好 (我已经知道错过之前愚蠢的明显东西),这里是我的生产LDAP环境中的工作ACL列表:)
# Access and Security Restrictions # (Most restrictive entries first) access to attrs=userPassword by self write by dn.sub="ou=sync,dc=mydomain,dc=com" read by anonymous auth by users none access to * by * read
access to * by * read的尾随access to * by * read是重要的,我没有看到它在你的例子中,所以我不知道它是否丢失或从你的代码片段中省略。
sync行用于我的LDAP同步服务,如果您不进行复制,则不需要