
我想為我的 OpenLDAP 上的子組織新增 ACL。
這是他們的 ACL 文件: https://www.openldap.org/doc/admin24/access-control.html
我用來ldapmodify
更新正在執行的 OpenLDAP 實例上的 ldap 資料庫。
這是LDIF我導入的文件:
vim ro_access.ldif
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcAccess
olcAccess: {2}to dn.children="ou=users,dc=example,dc=com" by dn.exact="cn=workstation,ou=applications,dc=example,dc=com" read
我預計
- 必須
cn=workstation,ou=applications,dc=example,dc=com
能夠閱讀以下兒童ou=users,dc=example,dc=com
- 必須
auth
具有前面的預設行為。 - 必須
anonymous
具有前面的預設行為。
我有
ldapwhoami
與...一起工作cn=workstation,ou=applications,dc=example,dc=com
ldapsearch
回傳結果uid=someone,ou=users,dc=example,dc=com
失敗cn=workstation,ou=applications,dc=example,dc=com
編輯
我嘗試olcAccess
{1}
用{2}
和{2}
替換{1}
。
這是完全替換的 ACL,它也不起作用:
dn: olcDatabase={1}mdb,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to attrs=userPassword,shadowLastChange by self write by dn="cn
=admin,dc=example,dc=com" write by dn="cn=ropw,dc=example,dc=co
m" read by anonymous auth by * none
olcaccess: {1}to dn.children="ou=users,dc=example,dc=com" by dn
.exact="cn=workstation,ou=applications,dc=example,dc=com" read
olcaccess: {2}to * by self write by dn="cn=admin,dc=example,dc=com" write
by dn="cn=ro,dc=example,dc=com" read by dn="cn=ropw,dc=exam
ple,dc=com" read by * none
知道為什麼嗎?
答案1
嘗試by anonymous auth by * none
在 ACL 指令末尾新增:
olcAccess: {1}to dn.children="ou=users,dc=example,dc=com" by dn
.exact="cn=workstation,ou=applications,dc=example,dc=com" read
by anonymous auth by * none