首页 > 解决方案 > OpenLDAP SSL 集成 - 修改 cn=config 的 ACL 权限

问题描述

我正在尝试在olcTLSCertificateFile.

dn: cn=config
changetype: modify
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/openldap/certs/file.crt

dn: cn=config
changetype: modify
replace: olcTLSCertificateKeyFile 
olcTLSCertificateKeyFile: /etc/openldap/certs/file.key

Single Sign-on我在 CentOS7 上使用 OpenSSL创建了这些证书。

openssl req -new -x509 -nodes -out /etc/openldap/certs/file.crt -keyout /etc/openldap/certs/file.key -days 3650

这是我添加到 using 的 ACL 权限

#monitor.ldif
dn: olcDatabase={1}monitor,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external, cn=auth" read by dn.base="cn=Manager,dc=domain,dc=com" read by * none

最后,我正在修改文件并收到错误:

ldapmodify -x -W -D "cn=Manager,dc=domain,dc=com"  -H ldapi:/// -f certs.ldif

Enter LDAP Password: 

 modifying entry "cn=config"

ldap_modify:访问权限不足 (50)

标签: sslopenldap

解决方案


我终于找到了解决方案。只需更改密钥和 crt 文件的顺序即可。

dn: cn=config
changetype: modify
replace: olcTLSCertificateKeyFile 
olcTLSCertificateKeyFile: /etc/openldap/certs/file.key

dn: cn=config
changetype: modify
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/openldap/certs/file.crt

推荐阅读