ldapadd / ldapmodify - 添加数据库参数

ldapadd / ldapmodify - adding database parameters

我是 ldap 的新手,想知道是否有人可以帮助我。

我已经 运行 完成了一个教程(并使其正常工作),但他们似乎正在做一些似乎不是正确的做法,我不不明白如何用另一种正确的方式来做的语法。

即: 手动编辑文件:/usr/local/etc/slapd.d/cn=config/'olcDatabase={0}config.ldif'

并添加到文件末尾:

olcRootDN: cn=admin,cn=config
olcRootPW: S0m3H@sH

'olcDatabase={0}config.ldif' 文件的内容(我已经散列了一堆东西所以忽略“x”):

# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
# CRC32 1cxxxxdc
dn: olcDatabase={0}config
objectClass: olcDatabaseConfig
olcDatabase: {0}config
olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=extern
 al,cn=auth" manage by * none
structuralObjectClass: olcDatabaseConfig
entryUUID: 241xxcxx-9xxx-xxx5-xxxe-xxxxxxxfxx2
creatorsName: cn=config
createTimestamp: 2020xxxxxxx2xx
entryCSN: 20201110xxxx8.7xxxxZ#000000#000#000000
modifiersName: cn=config
modifyTimestamp: 202xxxxxxxxx

现在文件头显示为“自动生成的文件 - 不要编辑!使用 ldapmodify”,所以我正在尝试使用 ldapmodify 更新文件并添加我需要的参数...我知道怎么做运行 ldapmodify,但不知道我如何着手 generating/creating ldif 进行更改。

我运行 ldap修改如下:

/usr/bin/ldapmodify -a -x -D "cn=Manager,dc=xxxxxx,dc=xxxxx,dc=xxx,dc=xx" -w "xxxxxxx" -f /etc/openldap/schema/update_rootdnpw.ldif

需要一些帮助来创建 update_rootdnpw.ldif 文件。

非常感谢!

终于明白了:

dn: olcDatabase={0}config,cn=config
changetype: modify
add: olcRootDN
olcRootDN: cn=admin,cn=config

dn: olcDatabase={0}config,cn=config
changetype: modify
add: olcRootPW
olcRootPW: {SSHA}<pass-hash>

并执行使用:

ldapmodify -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/update_rootdnpw.ldif