如何解决OpenLDAP ACL 不起作用 - 错误代码 50 - 没有对父级的写访问权限
我为应用服务构建了几个 OpenLDAP 服务器。两台服务器在配置方面似乎都很好,我可以使用 Apache Directory Studio 作为 RootDN cn=admin,dc=somedomain,dc=com 管理这些。并且复制也在它们之间起作用。这些是通过编译 OpenLDAP 源代码在 RHEL8 上构建的,因为不再提供 OpenLDAP 服务器包。 OpenLDAP 版本为 2.4.52。
我可以通过 Directory Studio 创建 OU 和用户,并在应用中使用其中之一作为服务帐户进行身份验证。在这种情况下,用户是 uid=svc-admin,ou=Admins,ou=People,dc=com,OU 如下:
- ou=Admins,dc=com
- ou=Readers,dc=com
- ou=Users,dc=com
现在的要求是用户 svc-admin 应该对上述 OU 具有写入/完全权限,因为该应用程序旨在配置新用户,并且它将使用 svc 写入上述 OU -admin 作为服务帐户。它应该能够创建用户并修改他们的属性。
我创建了一个 ACL 并且能够使用 ldapmodify 应用它,但是,当我作为 Apache DS 上的 svc-admin 连接到 LDAP 服务器时,我可以读取但不能修改或创建新用户。当我这样做时,我通过 Apache DS 和 shell 都收到错误消息。 权限不足 - 错误 50 - 没有对父级的写入权限。
这是我使用的 ACL:
library(doParallel)
un_id <- unique(data2$id)
out <- vector('list',length(un_id))
names(out) <- un_id
registerDoParallel(cl <- makeCluster(length(un_id)))
for(id1 in un_id) {
subdat <- subset(data2,id == id1)
out[[id1]] <- foreach(i = seq_len(nrow(subdat))) %dopar% {
a <- matrix(nrow = nrow(subdat),ncol=2)
for (j in seq(i)) {
for (k in 1:2) {
a[j,k] <- j*k
}
}
a
}
}
stopCluster(cl)
它不起作用。这是我的 olcDatabase={1}mdb 和 olcDatabase={0}config 文件。 我清理了 ACL,因为它们没有任何作用。
olcDatabase={1}mdb
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcAccess
olcAccess: to dn.subtree="ou=People,dc=com" by dn.exact="uid=svc-admin,dc=com" write
olcAccess: to dn.subtree="ou=Users,dc=com" write
olcAccess: to dn.subtree="ou=Readers,dc=com" write
olcDatabase={0}config:
# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
# CRC32 54063f10
dn: olcDatabase={1}mdb
objectClass: olcDatabaseConfig
objectClass: olcMdbConfig
olcDatabase: {1}mdb
olcDbDirectory: /var/lib/openldap
olcSuffix: dc=somedomain,dc=com
olcAccess: {0}to attrs=userPassword,shadowLastChange,shadowExpire by self wr
ite by anonymous auth by dn.subtree="gidNumber=0+uidNumber=0,cn=peercred,cn
=external,cn=auth" manage by * none
olcAccess: {1}to dn.subtree="dc=somedomain,dc=com" by dn.subtree="gidNumber=
0+uidNumber=0,cn=external,cn=auth" manage by users read by * re
ad
olcRootDN: cn=admin,dc=com
olcRootPW:: e1NTSEF9dkc0ZkIyYkZrYVduNU1BbTdkAHQ5ZXE0WlFEUHBSSGk=
olcDbIndex: uid pres,eq
olcDbIndex: cn,sn pres,eq,approx,sub
olcDbIndex: mail pres,sub
olcDbIndex: objectClass pres,eq
olcDbIndex: loginShell pres,eq
olcDbIndex: entryCSN eq
olcDbIndex: entryUUID eq
olcDbMaxSize: 42949672960
structuralObjectClass: olcMdbConfig
entryUUID: 3b57a8aa-b1d8-103a-87d6-7198db52aeab
creatorsName: gidNumber=0+uidNumber=0,cn=auth
createTimestamp: 20201103042439Z
olcSyncrepl: {0}rid=003 provider=ldaps://ldapserver01.somedomain.com binddn="
cn=admin,dc=com" bindmethod=simple credentials="TestCreds" s
earchbase="dc=somedomain,dc=com" type=refreshAndPersist timeout=0 network-t
imeout=0 retry="30 5 300 +"
olcSyncrepl: {1}rid=004 provider=ldaps://ldapserver02.somedomain.com binddn="
cn=admin,dc=com" type=refreshAndPersist timeout=0 network-t
imeout=0 retry="30 5 300 +"
olcMirrorMode: TRUE
entryCSN: 20210202222100.054442Z#000000#001#000000
modifiersName: gidNumber=0+uidNumber=0,cn=auth
modifyTimestamp: 20210202222100Z
我该如何解决这个问题。非常感谢您对解决此问题的任何帮助。
解决方法
我认为这可能不是合适的方法,但它对我有用。我从 olcDatabase={1}mdb ..
中删除了以下 ACLolcAccess: {0}to attrs=userPassword,shadowLastChange,shadowExpire by self wr
ite by anonymous auth by dn.subtree="gidNumber=0+uidNumber=0,cn=peercred,cn
=external,cn=auth" manage by * none
olcAccess: {1}to dn.subtree="dc=somedomain,dc=com" by dn.subtree="gidNumber=
0+uidNumber=0,cn=external,cn=auth" manage by users read by * re
ad
..并在 LDIF 文件中添加以下内容,现在用户帐户 svc-admin 可以执行该应用程序想要它执行的所有操作。
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcAccess
olcAccess: {0}to attrs=userPassword by self write by dn.exact="uid=svc-admin,ou=Admins,ou=People,dc=somedomain,dc=com" write by anonymous auth by * none
olcAccess: {1}to attrs=shadowLastChange by self write by dn.exact="uid=svc-admin,dc=com" write by * read
olcAccess: {2}to dn.subtree="ou=People,dc=com" by dn.exact="uid=svc-admin,dc=com" write
olcAccess: {3}to * by * read
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。