当我运行下一个命令时,全部都是:
ldapsearch -x -b "dc=icm,dc=movismart,dc=com" -D "cn=Manager,dc=icm,dc=movismart,dc=com" -W
但是,当我运行它时,这是一个问题“无效的凭据(49)”:
ldapsearch -x -b "dc=icm,dc=movismart,dc=com" -D "uid=sysadmin,dc=icm,dc=movismart,dc=com" -W
我的slapd.conf:
loglevel 1
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/openldap.schema
include /etc/openldap/schema/dyngroup.schema
allow bind_v2
pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
access to attrs=userPassword
by dn="cn=Manager,dc=icm,dc=movismart,dc=com" write
by self write
by anonymous auth
by * none
access to dn.base="" by * read
access to *
by dn="cn=Manager,dc=icm,dc=movismart,dc=com" write
by * read
database bdb
suffix "dc=icm,dc=movismart,dc=com"
rootdn "cn=Manager,dc=icm,dc=movismart,dc=com"
rootpw {SSHA}9xDlp+gBzA2E4EHXb4KXVkylAll7WmZd
directory /var/lib/ldap
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub
我的结构ldif:
dn: dc=icm,dc=movismart,dc=com
objectClass: domain
objectClass: top
dc: icm
dn: ou=People,dc=icm,dc=movismart,dc=com
objectclass: top
objectclass: organizationalUnit
ou: People
description: Container for user entries
我的系统管理员用户ldif:
dn: uid=sysadmin,ou=People,dc=icm,dc=movismart,dc=com
objectclass: top
objectclass: uidObject
objectclass: person
uid: sysadmin
cn: System Administrator
sn: sysadmin
userPassword: sysadmin
我使用纯文本,crypt,md5和ssha userPassword进行探查,什么也没有。
非常感谢!!
最佳答案
尝试这样做:
slappasswd -h {MD5}
相应地输入要求的密码。取得输出/结果并将其放入文件中:
nano config.ldif
该文件应如下所示:
dn: cn=config
changetype: modify
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: {MD5}inform password
dn: olcDatabase={0}config,cn=config
changetype: modify
delete: olcAccess
然后做
ldapadd -Y EXTERNAL -H ldapi:/// -f config.ldif
要操作openldap,请使用以下命令:
ldapadd -x -Y EXTERNAL -H ldapi:// -D cn=admin,cn=config -W -f file
现在应该可以了。
关于openldap - OpenLdap(Centos 5.9): Invalid credentials (49),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/20142379/