LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-19-2008, 04:01 AM   #1
akhtar.bhat
Member
 
Registered: Jan 2008
Posts: 34

Rep: Reputation: 15
Unhappy LDAP_add: Type or value exists (20)


Hi All,
First of all, is this necessary the name of Ldap directory should be same as that of DNS name like example.com ? I put it same
I have configured the slapd.conf as:


database bdb
suffix "dc=example,dc=com"
rootdn "cn=root,dc=example,dc=com"
rootpw {SSHA}YGEh7gVu6q0LjX4uL3nXLJ+PDgU3V+Rz

directory /var/lib/ldap/example.com


After this i make ldif directories of root and ldapuser their ldif files are as:

1. root.ldif

dn: uid=root,ou=People,dc=example,dc=com
uid: root
cn: root
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}$1$v.4x1iaJ$Sh2Q2hTroYNMPsMSJuTqb0
shadowLastChange: 13927
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 0
gidNumber: 0
homeDirectory: /root
gecos: root

dn: uid=operator,ou=People,dc=example,dc=com
uid: operator
cn: operator
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}*
shadowLastChange: 13927
shadowMax: 99999
shadowWarning: 7
loginShell: /sbin/nologin
uidNumber: 11
gidNumber: 0
homeDirectory: /root
gecos: operator

~
~
~



2.ldapusers.ldif


dn: uid=ldapuser,ou=People,dc=example,dc=com
uid: ldapuser
cn: ldapuser
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}$1$5QFLLz0.$BGW/uZBHsfJqGaD7p0iQs1
shadowLastChange: 13928
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 500
gidNumber: 100
homeDirectory: /home/ldapuser

~


after this i create the ldif file of ldap directory which was empty then i paste the file with the contents as shown below:

dn: dc=example,dc=com
dc: example
description: Root LDAP entry for example.com
objectClass: dcObject
objectClass: organizationalUnit
ou: rootobject

dn: ou=People, dc=example,dc=com
ou: People
description: All people in organisation
objectClass: organizationalUnit
~
~



after it i tried to import the ldif files i got this error:

ldapadd -x -D "cn=root,dc=example,dc=com" -W -f /etc/openldap/example.com.ldif
Enter LDAP Password:
adding new entry "dc=example,dc=com"
ldap_add: Type or value exists (20)
additional info: objectClass: value #1 provided more than once



Please tell me where I need to do the changes in every file. It is urgent please please let me kno about it as soon as possible that will be your most kindness

Thanks and Regards
Akhtar Bhat
 
Old 02-19-2008, 06:06 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Make sure you have a blank line at the end of /etc/openldap/example.com.ldif. You can use -v in the ldapadd command to make output more verbose.

Regards
 
Old 02-19-2008, 02:15 PM   #3
frndrfoe
Member
 
Registered: Jan 2008
Distribution: RHEL, CentOS, Ubuntu
Posts: 379

Rep: Reputation: 38
Quote:
First of all, is this necessary the name of Ldap directory should be same as that of DNS name like example.com ?
No, you could use "dc=Seattle,dc=Washington,dc=USA,dc=NorthAmerica" if you want.

when you edited your slapd.conf and then started ldap, you created dc=example,dc=com. You do not have to add that with an ldif.

I recommend not adding ldap management accounts within "ou=People,dc=example,dc=com" because that will make them usable accounts on every system that uses the directory. I would recommend using something like "cn=Manager,dc=example,dc=com"

And, every machine needs to have it's own root account so this wont work:
dn: uid=root,ou=People,dc=example,dc=com
Were you thinking of doing something like this in nsswitch.conf?
Code:
passwd:     ldap
shadow:     ldap
group:      ldap
Thats just crazy, you wouldn't be able to get into the computer if the network went down or if ldap failed.
 
  


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
Warning ___ specifies undefined mime type/service type mbvpixies78 Linux - Software 0 12-29-2007 10:25 PM
installing redhat 8.0 when text login in I cannot type password?? I type root scrist Linux - General 4 04-22-2006 02:20 AM
openldap: ldap_add: Naming violation (64) libregeek Linux - Networking 2 11-24-2005 12:51 AM
URGENT: ldap_add(): Add: Object class violation error 65 sierraaltae Linux - Security 1 08-05-2005 10:41 AM
SIOCADDRT: File exists SIOCCADDRT: File Exists Failed to bring up eth0. opsraja Linux - Networking 0 01-10-2005 08:29 AM

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

All times are GMT -5. The time now is 07:12 AM.

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