OpenLdap(Centos 5.9):凭据无效(49)

当我运行下一个命令时,它都是KO:

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

现在它应该工作。

链接地址: http://www.djcxy.com/p/75723.html

上一篇: OpenLdap (Centos 5.9): Invalid credentials (49)

下一篇: dificulty solving a code in O(logn)