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

添加一个用户

user.ldif

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 

试图解决这个问题

inetOrgPerson更改为uidObject并再次创build用户:

 [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来解决问题

没有findObjectClass inetOrgPerson

在这里输入图像说明

尝试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 (eg, implementation specific) error (80) additional info: olcObjectClasses: AttributeType not found: "audio" 

已经阅读的信息来源,不包含解决问题的解决scheme

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

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