LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-08-2011, 11:52 AM   #1
jeewiz
LQ Newbie
 
Registered: Jan 2007
Distribution: CentOS 6.5
Posts: 21

Rep: Reputation: 0
LDAP Useradd Issue


# slapcat
/etc/openldap/slapd.conf: line 113: warning: no by clause(s) specified in access line (ignored).
dn: dc=local,dc=net,dc=com
dc: local
objectClass: top
objectClass: domain
entryUUID: ...
creatorsName: cn=Manager,dc=local,dc=net,dc=com
createTimestamp: ...
entryCSN: ...
modifiersName: cn=Manager,dc=local,dc=net,dc=com
modifyTimestamp: ...

dn: cn=Manager,dc=local,dc=net,dc=com
objectClass: ogranizationalRole
cn: Manager
structuralObjectClass: organizationalRole
entryUUID: ...
creatorsName: cn=Manager,dc=local,dc=net,dc=com
entryCSN: ...
modifiersName: cn=Manager,dc=local,dc=net,dc=com
modifyTimestamp: ...

dn= ou=admins,dc=local,dc=net,dc=com
ou: admins
objectClass: top
objectClass: organizationalUnit
structuralObjectClass: organizationalUnit
entryUUID:...
creatorsName: cn=Manager,dc=local,dc=net,dc=com
createTimestamp: ...
entryCSN: ...
modifiersName: cn=Manager,dc=local,dc=net,dc=com
modifiersTimestamp: ...


# cat users.ldif
dn: uid=foobar,ou=admins,dc=local,dc=net,dc=com
uid: foobar
cn: foo bar
objectClass: account
objectClass: top
userPassword: {SSHA}...
shadowLastChange: ...
shadowMax: ....
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 601
gidNumber: 10
homeDirectory: /home/foobar


# ldapadd -x -D "cn=Manager,dc=local,dc=net,dc=com" -w <password> -f users.ldif
adding new entry "uid=foobar,ou=admins,dc=local,dc=net,dc=com"
ldapadd: Object class violation (65)
additional info: attribute 'cn' not allowed


What am I doing wrong with the user add?
 
Old 11-09-2011, 02:10 PM   #2
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
dn: cn=Manager,dc=local,dc=net,dc=com
objectClass: ogranizationalRole
cn: Manager
structuralObjectClass: organizationalRole
entryUUID: ...
creatorsName: cn=Manager,dc=local,dc=net,dc=com
entryCSN: ...
modifiersName: cn=Manager,dc=local,dc=net,dc=com
modifyTimestamp: ...

You are missing two objectClasses here
top and I believe person -

Think of object classes as an upside down tree - In order to use any element within tree you have to start with objectclass: top ----top leads to bunch of new objects and those objects lead to more.

So organizationalRole > Person > Top and with all of those they have required attributes that must be present.

There are a few websites out there that have the Hierarchy of all the objectclasses and just as a heads up objectclasses require header files be included in slapd.conf if not already in there.
 
1 members found this post helpful.
Old 11-10-2011, 01:10 PM   #3
jeewiz
LQ Newbie
 
Registered: Jan 2007
Distribution: CentOS 6.5
Posts: 21

Original Poster
Rep: Reputation: 0
Issue solved, I did have to add the following two object classes to make it look like the following:

objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Useradd Command To Add User To OpenSuse Box From LDAP ? prayingtosky Linux - Newbie 4 01-03-2011 09:02 PM
How To Use Useradd command against LDAP ? prayingtosky Linux - Newbie 1 12-12-2010 08:51 PM
LDAP synchronization issue ANU Linux - Security 0 07-06-2006 11:32 AM
Need Help, LDAP + BDB issue wslyhbb Linux - Software 7 04-25-2006 08:23 PM
Useradd - Cannot locate /etc/default/useradd in Solaris Paean Solaris / OpenSolaris 4 12-09-2005 01:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration