如何正确ldapmodifyreplaceolcAccess线?

这是来自olcDatabase = {1} hdb.ldif的一部分

olcAccess: {0}to attrs=userPassword,shadowLastChange by self write by anonymous auth by dn="cn=admin,dc=somesite,dc=com" write by * none olcAccess: {1}to dn.base="" by * read olcAccess: {2}to * by self write by dn="cn=admin,dc=somesite,dc=com" write by * read 

by dn="cn=anotheruser,ou=Users,dc=somesite,dc=com" write {0}{2}行。

在销毁我的LDAP服务器之前, 以下LDIF是否正确?

 dn: olcDatabase{1}hdb,cn=config changetype: modify replace: olcAccess olcAccess: {0}to attrs=userPassword,shadowLastChange by dn="cn=admin,dc=somesite,dc=com" write by dn="uid=anotheruser,ou=Users,dc=somesite,dc=com" write by anonymous auth by self write by * none olcAccess: {2}to * by self write by dn="cn=admin,dc=somesite,dc=com" write by dn="cn=anotheruser,ou=Users,dc=somesite,dc=com" write by * read 

使用: ldapmodify -Y EXTERNAL -H ldapi:/// -f ./changes.ldif

我的顾虑是:

  • 有3 olcAccess:行,我没有包括{1}行,所以在提交ldif更改后它仍然在那里
  • replace: olcAccess行是否正确?

先前的命令,这个ldif为我工作

 dn: olcDatabase{1}hdb,cn=config changetype: modify replace: olcAccess olcAccess: {0}to attrs=userPassword,shadowLastChange by dn="cn=admin,dc=somesite,dc=com" write by dn="uid=anotheruser,ou=Users,dc=somesite,dc=com" write by anonymous auth by self write by * none olcAccess: {1}to dn.base="" by * read olcAccess: {2}to * by self write by dn="cn=admin,dc=somesite,dc=com" write by dn="cn=anotheruser,ou=Users,dc=somesite,dc=com" write by * read