ldap - OpenLDAP 编辑 userPassword 属性 ACL
问题描述
我尝试创建可以读取其他用户密码的用户。我尝试编辑 openLDAP 中已经存在的 ACL,所以我写道:
dn: olcDatabase={1}mdb,cn=config
changetype: modify
replace: olcAccess
olcAccess: {1}to attrs=userPassword
by self write
by anonymous auth
by dn="cn=admin,dc=playground,dc=test,dc=local" write
by dn="cn=usermanager,ou=cloud,o=customer1,dc=playground,dc=test,dc=local" read
by * none
我这边对上面 olcAccess ACL 的唯一修改是:
by dn="cn=usermanager,ou=cloud,o=customer1,dc=playground,dc=test,dc=local" 阅读
在我这样做之后(通过 ldapmodify)我失去了以 usermanager 身份浏览 ldap 树的能力,但我可以登录,例如:
ldapsearch -x -D "cn=usermanager,ou=cloud,o=customer1,dc=playground,dc=test,dc=local" -W -LLL
返回:No such object (32)
ldapwhoami -x -D "cn=usermanager,ou=cloud,o=customer1,dc=playground,dc=test,dc=local" -W -LLL
返回:dn:cn=usermanager,ou=cloud,o=customer1,dc=playground,dc=test,dc=local
问题是:如何编写此 ACL 以授予用户usermanager
读取其他用户密码的权限?
解决方案
解决了:
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcAccess
olcAccess: {1}to attrs=userPassword
by self write
by anonymous auth
by dn="cn=admin,dc=playground,dc=test,dc=local" write
by dn="cn=usermanager,ou=cloud,o=customer1,dc=playground,dc=test,dc=local" read
by * none
如果有人想使用它,请手动编写而不是复制粘贴,因为 ldifs 对空格和行尾非常敏感。
推荐阅读
- c# - 从 C# 中的串行端口接收不均匀的结果
- mysql - 从 sql 中选择时将 varchar datetime 转换为 datetime
- sql - 将列中的值分隔到 SSMS 中的不同段或列
- c# - 为什么创建令牌时会创建错误
- azure - Azure 日志,找不到
- javascript - 使用 python 烧瓶的异步服务器消息
- erpnext - 如何将数据传递给另一个文档类型
- node.js - 具有大图像尺寸的 Base64 图像上的 Nodejs CORS 错误
- directx-9 - 为什么在以 ps_4_0 为目标时不支持 COLOR 作为输出语义,但在 vs_4_0 中支持?
- javaparser - JavaParser 中 VoidVisitorAdapter 和 GenericVisitorAdapter 的功能区别是什么