Centos 7上的ldap配置ACL [英] LDAP configuration ACL on centos 7

查看:21
本文介绍了Centos 7上的ldap配置ACL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为Manager用户设置ACL,原因是我了解语法错误所在。

修改olcDatabase={2}hdb文件正确吗?

我的终端命令:

ldapmodify -a -x -D "cn=Manager,dc=gruppo6,dc=labreti,dc=it" -w root -H ldap:// -f acl.ldif

这是错误:

ldapmodify: invalid format (line 5) entry: "olcDatabase={2}hdb"

acl.ldif:

dn: olcDatabase={2}hdb
changetype: modify
add: olcAccess
olcAccess:{0} to * by dn="cn=Manager,dc=gruppo6,dc=labreti,dc=it" manage by * break
{1} to attrs=userPassword by dn="cn=Manager,dc=gruppo6,dc=labreti,dc=it" write by self write by anonymous none by users none
{2} to attrs=loginShell by dn="cn=Manager,dc=gruppo6,dc=labreti,dc=it" write by self read by anonymous none by users none to attrs=uid,sn,homeDirectory by self write
{3} to dn.subtree="dc=gruppo6,dc=labreti,dc=it" by * read

olcDatabase={2}hdb.ldif:

# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
# CRC32 0c9c7626
dn: olcDatabase={2}hdb
objectClass: olcDatabaseConfig
objectClass: olcHdbConfig
olcDatabase: {2}hdb
olcDbDirectory: /var/lib/ldap
olcDbIndex: objectClass eq,pres
olcDbIndex: ou,cn,mail,surname,givenname eq,pres,sub
structuralObjectClass: olcHdbConfig
entryUUID: 05c622d2-9007-1039-808a-1106615e0d2d
creatorsName: cn=config
createTimestamp: 20191031084858Z
olcRootPW:: e1NTSEF9QXNRTGdiYjZ0RTltMjMwbHdFcW5VeE5ETzNxcE1qSXE=
olcSuffix: dc=gruppo6,dc=labreti,dc=it
olcRootDN: cn=Manager,dc=gruppo6,dc=labreti,dc=it
entryCSN: 20191031122732.077139Z#000000#000#000000
modifiersName: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
modifyTimestamp: 20191031122732Z

感谢各位的帮助

推荐答案

有两个问题:

  • 您正在尝试使用acl.ldif中的错误DN修改olcDatabase={2}hdb,此条目应位于cn=config的子树中。您可以使用以下命令获取目标olcDatabase:

    slapcat -n 0 -a olcDatabase=hdb
    
    # Output 
    dn: olcDatabase={2}hdb,cn=config
    ...
    
  • 由于您正在修改现有条目,因此在ldapmodify命令中不需要-a标志(ldapadd):

    ldapmodify -x -D "cn=Manager,dc=gruppo6,dc=labreti,dc=it" -w root -H ldap:// -f acl.ldif
    

如果您的ldap管理员由于权限不足(正在读取此指令to * by dn="cn=Manager,dc=gruppo6,dc=labreti,dc=it" manage)而无法修改此配置条目,您仍可以使用外部绑定(Unix用户)来执行此类操作:

ldapmodify -Y EXTERNAL -H ldapi:/// -f acl.ldif 

这篇关于Centos 7上的ldap配置ACL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆