创build具有访问权限的OpenLDAP用户只能更改每个人的密码
在我的PHP脚本中,我写了一个函数,使用户能够更改他们的openldap密码,我使用了php函数,如ldap_connect,ldap_bind,ldap_search,ldap_modify。 首先我想,也许最好给每个用户提供访问权限来更改自己的密码,但是对于ldap_bind这种方式,我们仍然需要用户pipe理员用户凭证来成功绑定。 所以我想创build一个新的用户可以绑定和更改每个人的密码,所以我不必在代码中的用户pipe理员。 我创build了这些ldif文件 superuser.ldif: dn: cn=superuser,dc=test,dc=com cn: superuser objectClass: simpleSecurityObject objectClass: organizationalRole description: LDAP write password user userPassword: {crypt}superuserpass 超级用户acl.ldif dn: olcDatabase={1}hdb,cn=config changetype: modify delete: olcAccess – add: olcAccess olcAccess: to attrs=userPassword,shadowLastChange by dn="cn=superuser,dc=test,dc=com" write 我用这些命令应用ldif文件: ldapadd -x -H ldap://openldap.localhost -w ldapadminpass -D "cn=admin,dc=test,dc=com" -f /ldif/superuser.ldif 和 ldapmodify -Y EXTERNAL -Q -H ldapi:/// -f […]