Eu instalei o OpenLDAP no Centos 7 e tentei criar o usuário admin. Mas eu tenho algum erro em ldap_modify
. Abaixo estão os meus passos:
Instale o OpenLDAP e inicie-o:
sudo yum install openldap openldap-servers openldap-clients -y
systemctl start slapd.service
Crie admin.ldif
dn: olcDatabase={0}config,cn=config
changetype: modify
add: olcRootPW
olcRootPW: {SSHA}CRiUMh5UM8/chPHbfc2Se2JA8Quc5F1P
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=ldapadmin,dc=demo,dc=local" read by * none
dn: olcDatabase={2}bdb,cn=config
changetype: modify
replace: olcSuffix
olcSuffix: dc=demo,dc=local
dn: olcDatabase={2}bdb,cn=config
changetype: modify
replace: olcRootDN
olcRootDN: cn=ldapadmin,dc=demo,dc=local
dn: olcDatabase={2}bdb,cn=config
changetype: modify
add: olcRootPW
olcRootPW: {SSHA}CRiUMh5UM8/chPHbfc2Se2JA8Quc5F1P
dn: olcDatabase={2}bdb,cn=config
changetype: modify
add: olcAccess
olcAccess: {0}to attrs=userPassword,shadowLastChange by
dn="cn=ldapadmin,dc=demo,dc=local" write by anonymous auth by self write by * none
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to * by dn="cn=ldapadmin,dc=demo,dc=local" write by * read
Execute abaixo da linha de comando:
ldapmodify -Y EXTERNAL -H ldapi:/// -f /root/demo/users/admin.ldif
Depois recebi este erro :
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "olcDatabase={2}bdb,cn=config"
ldap_modify: No such object (32)
matched DN: cn=config
Eu não tive esse erro em um sistema diferente usando o Centos 7, então estou me perguntando o que está acontecendo aqui.
Por favor ajude.