AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 770553
Accepted
fghj
fghj
Asked: 2016-04-16 02:03:30 +0800 CST2016-04-16 02:03:30 +0800 CST 2016-04-16 02:03:30 +0800 CST

openldap 授予组对子树的写访问权限

  • 772

我有

dn: ou=people,dc=example,dc=com
objectClass: organizationalUnit
ou: people

和它的管理员组:

dn: cn=people-admins,ou=groups,dc=example,dc=com
objectClass: groupOfUniqueNames
cn: admins of people group
uniqueMember: uid=admin1,ou=people,dc=example,dc=com

我添加了这样的规则以允许people-admins添加/删除/修改people组中的用户

dn: olcDatabase={1}hdb,cn=config
changetype: modify
delete: olcAccess
-
add: olcAccess
olcAccess: to attrs=userPassword,shadowLastChange by self write by dn="cn=admin,dc=example,dc=com" write by anonymous auth by * none
olcAccess: to dn.one="ou=people,dc=example,dc=com" by group.exact=cn=people-admins,ou=groups,dc=example,dc=com write by self write by dn="cn=admin,dc=example,dc=com" write by * none
olcAccess: to dn.base="ou=people,dc=example,dc=com" by group.exact=cn=people-admins,ou=groups,dc=example,dc=com write by self write by dn="cn=admin,dc=example,dc=com" write by * none
olcAccess: to dn.children="ou=people,dc=example,dc=com" by group.exact=cn=people-admins,ou=groups,dc=example,dc=com write by self write by dn="cn=admin,dc=example,dc=com" write by * none
olcAccess: to dn.subtree="ou=people,dc=example,dc=com" by group.exact=cn=people-admins,ou=groups,dc=example,dc=com write by self write by dn="cn=admin,dc=example,dc=com" write by * none
olcAccess: to * by self write by dn="cn=admin,dc=example,dc=com" write by * none

然后我尝试people使用 admin1 的凭据将新用户添加到组中,并得到了这个:

ldapadd -x -H ldap://127.0.0.1:3000/  -D "uid=admin1,ou=people,dc=example,dc=com" -W
dn: uid=test1,ou=people,dc=example,dc=com
objectClass: inetOrgPerson
uid: test1
sn: test
givenName: test1
cn: test test1
displayName: Test1
userPassword: test1
adding new entry "uid=test1,ou=people,dc=example,dc=com"
ldap_add: Insufficient access (50)
        additional info: no write access to parent

这里类似的问题,但它收到错误的答案,因为dn.entry在openldap中不存在。

ldap openldap access-control-list
  • 2 2 个回答
  • 3973 Views

2 个回答

  • Voted
  1. Best Answer
    fghj
    2016-04-16T09:21:18+08:002016-04-16T09:21:18+08:00

    问题是group.exact不能与groupOfUniqueNames. 我通过更改此规则解决了它:

    by group.exact=cn=people-admins,ou=groups,dc=example,dc=com write
    

    这条规则:

    by group/groupOfUniqueNames/uniqueMember=cn=people-admins,ou=groups,dc=example,dc=com write
    
    • 2
  2. 84104
    2016-04-16T15:25:12+08:002016-04-16T15:25:12+08:00

    如果您刚刚开始,我建议切换到 usinggroupOfNames而不是groupOfUniqueNames.

    大多数与 OpenLDAP 交互以获得组成员身份的系统默认需要 groupOfNames,包括 OpenLDAP 本身。虽然它们通常可以修改为使用 groupOfUniqueNames/uniqueMember(例如,或者您自己在 OpenLDAP 的 olcAccess 中使用),但这将使您不必调整默认值。sssd-ldap ldap_group_member


    distinguishedNameMatch, used bymember和uniqueMemberMatchused by之间有区别uniqueMember,但前者通常就足够了。

    $ ldapadd <<EOF
    dn: cn=testgroup,ou=groups,dc=example,dc=com
    > objectclass: groupofnames
    > member: uid=testuser,ou=people,dc=example,dc=com
    > member: uid=testuser,ou=people,dc=example,dc=com
    > EOF
    SASL/GSSAPI authentication started
    SASL username: [email protected]
    SASL SSF: 56
    SASL data security layer installed.
    adding new entry "cn=testgroup,ou=groups,dc=example,dc=com"
    ldap_add: Type or value exists (20)
        additional info: member: value #0 provided more than once
    
    
    
    $ ldapsearch cn=testgroup
    dn: cn=testgroup,ou=groups,dc=example,dc=com
    objectClass: groupOfNames
    objectClass: posixGroup
    cn: testgroup
    gidNumber: 12345
    member: uid=testuser,ou=people,dc=example,dc=com
    
    $ ldapmodify <<EOF
    dn: cn=testgroup,ou=groups,dc=example,dc=com
    add: member
    member: uid=testuser,ou=people,dc=example,dc=com
    EOF
    
    SASL/GSSAPI authentication started
    SASL username: [email protected]
    SASL SSF: 56
    SASL data security layer installed.
    modifying entry "cn=testgroup,ou=groups,dc=example,dc=com"
    ldap_modify: Type or value exists (20)
        additional info: modify/add: member: value #0 already exists
    
    • 1

相关问题

  • Cygwin sshd 和 LDAP 身份验证

  • 从 OpenLDAP 检索操作属性

  • 为 Mac 网络使用 Linux 和 Open LDAP

  • 使用LDAP服务器身份验证的Linux中单个用户的多个登录名

  • 使用 smbldap 管理用户/组的 Web 前端

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve