0

我正在尝试使用以下命令在 LDAP 中添加新用户:

ldapadd -H ldap://localhost:1389 -x -D cn=root -w secret -f ./user.ldif

user.ldif文件包含的数据为

dn: cn=ldapjs, ou=users, o=myhost
objectClass: unixUser
cn: ldapjs
shell: /bin/bash
description: Created via ldapadd

当我尝试运行 ldapadd 命令时,出现以下错误,并且找不到出错的位置:

**ERROR**
ldap_add: Constraint violation (19)
    matched DN: ou=users, o=myhost
    **additional info: cn required**

在这里,我在 url 中运行ldapjs 服务器:'ldap://127.0.0.1:1389' 以 root 模式运行。

4

1 回答 1

0

The error is occurred due to the ldapjs server API. The example code shared in ldapjs.org is not suitable for the latest ldapjs API. We can fix the issue by changing req.dn.rdn[0].cn to req.dn.rdn[0].attrs.cn

于 2016-08-12T10:13:27.020 回答