我将 OpenLDAP 2.4.54 与 Alpine 一起使用。这是我的 ldap 配置
$ sudo slapcat -n0
dn: olcDatabase={-1}frontend,cn=config
objectClass: olcDatabaseConfig
objectClass: olcFrontendConfig
olcDatabase: {-1}frontend
structuralObjectClass: olcDatabaseConfig
entryUUID: afb8286a-68e7-426d-8a9f-91f52935c4af
creatorsName: cn=config
createTimestamp: 20200807074746Z
entryCSN: 20200807074746.355242Z#000000#000#000000
modifiersName: cn=config
modifyTimestamp: 20200807074746Z
dn: olcDatabase={0}config,cn=config
objectClass: olcDatabaseConfig
olcDatabase: {0}config
olcAccess: {0}to * by * none
olcAddContentAcl: TRUE
olcLastMod: TRUE
olcMaxDerefDepth: 15
olcReadOnly: FALSE
olcRootDN: cn=config
olcSyncUseSubentry: FALSE
olcMonitoring: FALSE
structuralObjectClass: olcDatabaseConfig
entryUUID: 570fed11-408d-42a2-bf96-3e063cc8276e
creatorsName: cn=config
createTimestamp: 20200807074746Z
entryCSN: 20200807074746.355548Z#000000#000#000000
modifiersName: cn=config
modifyTimestamp: 20200807074746Z
dn: olcDatabase={1}mdb,cn=config
objectClass: olcDatabaseConfig
objectClass: olcMdbConfig
olcDatabase: {1}mdb
olcDbDirectory: /var/lib/openldap/openldap-data
olcSuffix: dc=mydomain,dc=tld
olcRootDN: cn=admin,dc=mydomain,dc=tld
olcRootPW:: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
olcDbIndex: objectClass eq
structuralObjectClass: olcMdbConfig
entryUUID: 5e4e308d-3243-4dd0-aa45-d289eb5575ab
creatorsName: cn=config
createTimestamp: 20200807074746Z
entryCSN: 20200807074746.355490Z#000000#000#000000
modifiersName: cn=config
modifyTimestamp: 20200807074746Z
我无法使用 SASL 身份验证编辑 cn=config 数据库:
ldapmodify -Y EXTERNAL -H ldapi:/// -f anything.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=1000+uidNumber=1000,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "cn=config"
ldap_modify: Insufficient access (50)
我无法使用根 dncn=config
进行身份验证:
ldapmodify -H ldapi:/// -D cn=config -f anything.ldif
ldap_bind: Server is unwilling to perform (53)
additional info: unauthenticated bind (DN with no password) disallowed
现在。既然我似乎对此没有任何权限,我该如何编辑此数据库中的任何内容?我可以尝试使用gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
witholcAccess
或添加olcRootPW
for访问权限,cn=config
但我无权执行此操作。
我该如何解决这是一个先有鸡还是先有蛋的问题?
我不确定这是否是一个好习惯,但我可以通过手动添加一个来解决这个
olcRootPW
问题/etc/openldap/slapd.d/cn=config/olcDatabase={0}config.ldif