debian – 如何正确ldapmodify替换olcAccess线?

前端之家收集整理的这篇文章主要介绍了debian – 如何正确ldapmodify替换olcAccess线?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
这是olcD​​atabase = {1} hdb.ldif的一部分
  1. olcAccess: {0}to attrs=userPassword,shadowLastChange
  2. by self write
  3. by anonymous auth
  4. by dn="cn=admin,dc=somesite,dc=com" write
  5. by * none
  6. olcAccess: {1}to dn.base="" by * read
  7. olcAccess: {2}to *
  8. by self write
  9. by dn="cn=admin,dc=com" write
  10. by * read

我想通过dn =“cn = anotheruser,ou = Users,dc = somesite,dc = com”追加到{0}和{2}行.

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

  1. dn: olcDatabase{1}hdb,cn=config
  2. changetype: modify
  3. replace: olcAccess
  4. olcAccess: {0}to attrs=userPassword,shadowLastChange
  5. by dn="cn=admin,dc=com" write
  6. by dn="uid=anotheruser,ou=Users,dc=com" write
  7. by anonymous auth
  8. by self write
  9. by * none
  10. olcAccess: {2}to *
  11. by self write
  12. by dn="cn=admin,dc=com" write
  13. by dn="cn=anotheruser,dc=com" write
  14. by * read

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

我担心的是:

>有3个olcAccess:行,我没有包含{1}行
在提交ldif更改后它仍然存在
>是替换:olcAccess线是否正确?

这个ldif为我工作,以前的命令
  1. dn: olcDatabase{1}hdb,dc=com" write
  2. by anonymous auth
  3. by self write
  4. by * none
  5. olcAccess: {1}to dn.base="" by * read
  6. olcAccess: {2}to *
  7. by self write
  8. by dn="cn=admin,dc=com" write
  9. by * read

猜你在找的Bash相关文章