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

时间:2013-11-22 10:18:59

标签: openldap

当我运行下一个命令时,它全是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进行探测,没有任何内容。

非常感谢!!

1 个答案:

答案 0 :(得分:4)

尝试这样做:

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

现在应该可以了。