OpenLDAP不让我添加用户

我试图在RHEL盒子上设置一个独立的OpenLDAP,但是在尝试将用户导入到系统中时遇到了一些麻烦。

如果我input以下命令:

ldapadd -x -h localhost -D 'cn=Users,dc=internal,dc=priv' -W -f user.ldif 

我得到以下回应:

 Enter LDAP Password: ldap_bind: Invalid credentials (49) 

在ldap服务器本身上出现以下内容:

 slap_listener_activate(7): >>> slap_listener(ldap:///) connection_get(11): got connid=1 connection_read(11): checking for input on id=1 ber_get_next ber_get_next: tag 0x30 len 45 contents: ber_get_next do_bind ber_scanf fmt ({imt) ber: ber_scanf fmt (m}) ber: >>> dnPrettyNormal: <cn=Users,dc=internal,dc=priv> <<< dnPrettyNormal: <cn=Users,dc=internal,dc=priv>, <cn=users,dc=internal,dc=priv> do_bind: version=3 dn="cn=Users,dc=internal,dc=priv" method=128 send_ldap_result: conn=1 op=0 p=3 send_ldap_response: msgid=1 tag=97 err=49 ber_flush: 14 bytes to sd 11 connection_get(11): got connid=1 connection_read(11): checking for input on id=1 ber_get_next ber_get_next on fd 11 failed errno=0 (Success) connection_closing: readying conn=1 sd=11 for close connection_close: conn=1 sd=11 

我不太了解LDAP – 任何人都可以提出一个前进的方向?

您应该以具有修改数据库凭据的用户身份绑定到您的LDAP数据库。 一种方法是使用在slapd.conf文件中定义的pipe理员用户( rootdn somethinghere )。

因此,如果在slapd.conf中有rootdn cn=TheMightyRootUser,ou=users,dc=internal,dc=priv ,请为cn=TheMightyRootUser,ou=users,dc=internal,dc=priv提供cn=TheMightyRootUser,ou=users,dc=internal,dc=priv作为-D参数。

-D'cn = Users,dc = internal,dc = priv'可能没有意义。 我想你想添加一个用户到ou = Users,dc = internal,dc = priv。 ou表示LDAP中的一个子树。 cn表示LDAPlogging。

-D后面跟着包含LDAPpipe理帐户('binddn')的条目。

CN =用户,等等。 会是pipe理员用户的一个奇怪的名字。

可能猜测没有cn =用户等。 你可能应该用cn = admin,dc = internal,dc = priv来replace它(引号是多余的)。 您应该编辑ldif文件以反映您想要将条目置于ou = Users子树中的事实

另一种可能是您的LDAP安装使用SASL,而不是简单的身份validation(用-x表示)