如何向在 CentOS7 上运行的 OpenLDAP 添加包含 UID 的用户?

如何向在 CentOS7 上运行的 OpenLDAP 添加包含 UID 的用户?

添加用户

用户目录

dn: uid=sampleuser,ou=people,dc=my-domain,dc=com
objectClass: top
objectClass: inetOrgPerson
cn: sample user
uid: sampleuser

问题

[root@host ~]# ldapadd -x -W -D "cn=Manager,dc=my-domain,dc=com" -f user.ldif
Enter LDAP Password:
adding new entry "uid=sampleuser,ou=people,dc=my-domain,dc=com"
ldap_add: Invalid syntax (21)
        additional info: objectClass: value #1 invalid per syntax

尝试解决问题

更改inetOrgPersonuidObject再次创建用户:

[root@controller ~]# ldapadd -x -W -D "cn=Manager,dc=my-domain,dc=com" -f user.ldif
Enter LDAP Password:
adding new entry "uid=sampleuser,ou=people,dc=my-domain,dc=com"
ldap_add: Object class violation (65)
        additional info: no structural object class provided

尝试 2 解决问题

inetOrgPerson未找到ObjectClass :

在此处输入图片描述

尝试 3 解决问题

无法添加架构inetOrgPerson

[root@controller ~]# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/inetorgperson.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=inetorgperson,cn=schema,cn=config"
ldap_add: Other (e.g., implementation specific) error (80)
        additional info: olcObjectClasses: AttributeType not found: "audio"

已经阅读过的资料,且不包含解决问题的解决方案

http://docs.adaptivecomputing.com/viewpoint/hpc/Content/topics/1-setup/installSetup/settingUpOpenLDAPOnCentos6.htm

http://www.zytrax.com/books/ldap/ch3/

https://stackoverflow.com/questions/28938957/openldap-structural-objectclass-not-found

http://www.openldap.org/doc/admin24/schema.html

http://www.openldap.org/lists/openldap-software/200503/msg00640.html

http://www.openldap.org/lists/openldap-technical/201002/msg00147.html

http://www.openldap.org/lists/openldap-technical/201002/msg00139.html

答案1

inetOrgPerson取决于和corecosine看起来您已经有了核心。添加余弦,然后添加 inetorgperson。余弦应该在/etc/openldap/schema/cosine.ldif

相关内容