0
votes

When i try to create an user in the OpenLDAP server in ubuntu

using the command "ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f user.ldif"

my user.ldif file is


dn: uid=john,ou=people,dc=example,dc=com

objectClass: inetOrgPerson

objectClass: posixAccount

objectClass: shadowAccount

uid: john

sn: Doe

givenName: John

cn: John Doe

displayName: John Doe

uidNumber: 1000

gidNumber: 10000

userPassword: password

gecos: John Doe

loginShell: /bin/bash

homeDirectory: /home/john

shadowExpire: -1

shadowFlag: 0

shadowWarning: 7

shadowMin: 8

shadowMax: 999999

shadowLastChange: 10877

mail: [email protected]

postalCode: 31000

l: Toulouse

o: Example

mobile: +33 (0)6 xx xx xx xx

homePhone: +33 (0)5 xx xx xx xx

title: System Administrator

postalAddress:

initials: JD


i am getting the error

"additional info: objectClass: value #0 invalid per syntax"

Can some one help me to resolve this problem?

1
Do you have all those object class schemas loaded?user207421

1 Answers

0
votes

OK, I added this account to a test box I have nearby. The ONLY thing I had to edit was "postalAddress" since you had it empty. Once this was fixed, the entry added without incident.

Considering the error was OBJECTCLASS related, I doubt the "postalAddress" being empty had anything to do with your problem.

So, knowing that it worked on my end, I'm going to assume perhaps you have an older build of OpenLDAP, and perhaps one of the schema files is either incorrectly edited, OR was missing entirely. This is purely a guess however, considering I cannot reproduce the issue.

Max