使用以下命令修改Open-LDAPconfiguration时:
dn: olcDatabase={2}hdb,cn=config changetype: modify replace: olcAccess olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" write by * none
我得到的错误:
ldap_modify: Other (eg, implementation specific) error (80) additional info: <olcAccess> handler exited with 1
这是因为ldif文件中的行继续移除了第一个空格,并且该属性被认为是: {0}to *by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" writeby * none (这是无效的)
因此,在连续的前面放置一个额外的空间:
dn: olcDatabase={2}hdb,cn=config changetype: modify replace: olcAccess olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" write by * none
请记住,当您的olcAccess语句也有其他语法问题时,会引发此错误。 例如,我在一个不属于那里的“by”子句中使用了一个关键字,而不是告诉我“你不能在这里使用'UID'”它一直说“slapd:line 0:expect'access'得到了[我的DN]“。 这件事的错误是愚蠢的。
你需要创build这个文件mod_acl.ldif与以下内容的确切格式,非常棘手。 并使用以下命令:
ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f mod_acl.ldif
期待的结果是:
modifying entry "olcDatabase={1}mdb,cn=config"
dn: olcDatabase={1}mdb,cn=config replace: olcAccess olcAccess: to attrs=userPassword,shadowLastChange,krbPrincipalKey by dn="cn=admin,dc=example,dc=com" write by anonymous auth by self write by * none - add: olcAccess olcAccess: to dn.base="" by * read - add: olcAccess olcAccess: to * by dn="cn=admin,dc=example,dc=com" write by * read
请小心,Ldap数据库的types可以根据您的实现进行更改,可以是mdb , hdb或其他,具体取决于您的安装。