我一直试图允许位于某个组中的openLDAP用户(EX: cn=Admins,dc=mydomain,dc=com ) create, modify, update, and delete另一个organizationalUnit用户(EX: ou=Users,dc=mydomain,dc=com )大约两个星期。 我已经尽了一切力量来解决这个问题。 比如通过Googlesearch,通过serverfaultsearch,最后通过stackoverflowsearch却无济于事。 我是相当新的openLDAP,它可能是一个错误和/或我忽略dn: olcDatabase={1}hdb,cn=config的olcAccess属性。
Admin Group.ldif
dn: cn=Admins,dc=ldapserver,dc=com changetype: add objectClass: groupOfNames objectClass: top member: cn=admin,ou=Users,dc=ldapserver,dc=com cn: Admins
Users.ldif
dn: ou=Users,dc=ldapserver,dc=com changetype: add objectClass: organizationalUnit objectClass: top ou: Users
默认olcAccess
注意:这是全新安装的openLDAP服务器附带的默认ACL。
dn: olcDatabase={1}hdb,cn=config olcAccess: {0}to attrs=userPassword by self write by anonymous auth by * none olcAccess: {1}to attrs=shadowLastChange by self write by * read olcAccess: {2}to * by * read
请注意1:因为我对openLDAP相当陌生,所以我没有设置除首次安装openLDAP服务器时默认出现的其他ACLs 。
请注意2:在我问我的问题之前,我在这里试过这个问题,显然没有为我工作。
谢谢,Alex
openldap中的ACL始终从编号为{0},{1},…的行的列表的顶部到底部进行计算。只要条件满足,评估立即停止(假设不使用中断)。
在Ubuntu设置的默认ACL中,兼容的是:
olcAccess:{2}通过*阅读
到* by *:遇到所有东西,加完后都没有效果。
在这个链接和上面讨论的解决scheme应该解决你的问题,我build议你试试这个ACL列表:
olcAccess: {0}to attrs=userPassword by self write by anonymous auth by * none olcAccess: {1}to attrs=shadowLastChange by self write by * read olcAccess: {2}to dn.subtree="ou=Users,dc=ldapserver,dc=com" by group/groupOfUniqueNames/uniqueMember="cn=Admins,dc=ldapserver,dc=com" write
并将admins组的objectClass更改为groupOfUniqueNames。