ldapadd / ldapmodify-添加数据库参数

问题描述

在ldap方面,我是n00b,想知道是否有人可以帮助我。

我已经看完了一个教程(并使其正常工作),但是他们似乎在做某些似乎不是正确的方法,而且我也不了解该如何做。用另一种正确的方法做。

即: 手动编辑文件:/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,但不知道如何生成/创建ldif进行更改。

我运行ldapmodify之类的东西

/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

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...