LDAP(slapd)authentication用户不能修改自己

我是一个完全LDAP新手,可能犯了一些非常愚蠢的错误,所以希望有人能指出我的正确方向。 我在Linux下从openldap 2.4.23运行slapd。 我遇到的问题是,从我在slapd.conf(cn = Manager,dc = example,dc = com)中设置的pipe理帐户中,我可以毫无问题地设置最终用户的密码:

# ldappasswd -D 'cn=Manager,dc=example,dc=com' -W -S 'uid=tsuraan,ou=People,dc=example,dc=com' 

但是,从最终用户的angular度来看,我可以运行search等,但我不能更改密码:

 $ ldapsearch -x -D "uid=tsuraan,ou=People,dc=example,dc=com" -W Enter LDAP Password: <results> $ ldappasswd -D 'uid=tsuraan,ou=People,dc=example,dc=com' -W -S 'uid=tsuraan,ou=People,dc=example,dc=com' New password: Re-enter new password: Enter LDAP Password: Result: Insufficient access (50) 

我也尝试使用ldapmodify直接更改userPassword属性,并提供相同的访问权限不足(50)消息。 我的slapd ACL部分如下所示:

 access to * by dn="uid=root,ou=People,dc=example,dc=com" write by users read by self write by anonymous auth access to attrs=userPassword,gecos,description,loginShell by self write access to attrs="userPassword" by dn="uid=root,ou=People,dc=example,dc=com" write by anonymous auth by self write by * none 

而且,我有一个非root用户,其LDIF如下所示:

 dn: uid=tsuraan,ou=People,dc=example,dc=com uid: tsuraan cn: tsuraan objectClass: account objectClass: posixAccount objectClass: top userPassword: {crypt}x loginShell: /bin/bash uidNumber: 1000 gidNumber: 1000 homeDirectory: /home/tsuraan 

Google今天不给我任何爱,我不明白为什么我的用户不能写信给他自己的LDAP节点,因为我已经“自我写”到处都是,所以希望有人能帮我一把。

 Lists of access directives are evaluated in the order they appear in slapd.conf. When a <what> clause matches the datum whose access is being evaluated, its <who> clause list is checked. When a <who> clause matches the accessor's properties, its <access> and <control> clauses are evaluated. Access control checking stops at the first match of the <what> and <who> clause, unless otherwise dictated by the <control> clause. 

首先与尝试更改密码的<what><who>匹配的是:

 access to * by users read 

如果您在列表末尾移动“访问*”子句,它应该可以正常工作。 或者只是交换“由用户阅读”和“由自己写”的顺序。

ACL是OpenLDAPconfiguration中最棘手的部分,因此请仔细阅读slapd.access(5) ,并确保在编写一些不重要的内容之前,完全理解ACL如何工作。