| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-10-2012, 09:46 PM
|
#1
|
|
Member
Registered: Dec 2011
Location: India
Distribution: Centos,redhat,zentyal
Posts: 43
Rep: 
|
LDAP- Intiital file import Failed
Hi everyone,
i am using centos 5.6 for openldap server, so i have created basic ldif file and imported using this command "ldapadd" everything is well.
my requirement:
i need to change or add some entries in existing ldif file and update again.
but i am getting error. also here with i have mention ldif file.
cat basic.ldif
dn: dc=example,dc=com
objectClass: dcObject
objectClass: organization
dc: example
o: Mydomain
description: my Corporation
# Hold users
dn: ou=People,dc=example,dc=com
objectClass: organizationalUnit
ou: People
#----------------------------------
2. now i need to add some line in basic.ldif file.
cat basic.ldif
dn: dc=example,dc=com
objectClass: dcObject
objectClass: organization
dc: example
o: Mydomain
description: my Corporation
# Hold users
dn: ou=People,dc=example,dc=com
objectClass: organizationalUnit
ou: People
# All info
dn: ou=Info,dc=example,dc=com
objectclass: organizationalUnit
ou: Info
now i am try to update new entry, using this below command. but i am getting "ldapmodify: No such object (32)" error.
#ldapmodify -f /etc/openldap/basic.ldif -x -D "cn=Manager,dc=example,dc=com" -W
Enter LDAP Password:*******
modifying entry "dc=example,dc=com"
modifying entry "ou=People,dc=example,dc=com"
modifying entry "ou=Info,dc=example,dc=com"
ldapmodify: No such object (32)
matched DN: dc=example,dc=com
if know ans.. please help me. thank's
Last edited by unibox; 02-13-2012 at 01:00 PM.
|
|
|
|
02-11-2012, 04:17 AM
|
#2
|
|
LQ Veteran
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,711
|
Hi unibox,
Please don't delete the original question.
Looking at the [SOLVED] tag I can only assume you found the answer to your problem. Next time post this answer so that others might benefit from it (even if you think it was a "stupid/dumb" mistake).
Also: Of the zero-reply list.
Last edited by druuna; 02-11-2012 at 01:55 PM.
Reason: spelling
|
|
|
|
02-13-2012, 12:28 PM
|
#3
|
|
Member
Registered: Dec 2011
Location: India
Distribution: Centos,redhat,zentyal
Posts: 43
Original Poster
Rep: 
|
Hi druuna
Actually I did not get the answer, that why I deleted my post. No problem I will re-update my question.
|
|
|
|
02-13-2012, 03:56 PM
|
#4
|
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Debian, FreeBSD, Ubuntu (desktop)
Posts: 3,859
Rep: 
|
@unibox: Looks like you didn't add DN: ou=Info,dc=example,dc=com correctly. Right?
You can easily confirm with slapcat(8).
|
|
|
|
02-13-2012, 11:33 PM
|
#5
|
|
Member
Registered: Dec 2011
Location: India
Distribution: Centos,redhat,zentyal
Posts: 43
Original Poster
Rep: 
|
hi anomie thanks for reply
i already added DN entry's in basci.ldif file.
i.e
cat basic.ldif
dn: dc=example,dc=com
objectClass: dcObject
objectClass: organization
dc: example
o: Mydomain
description: my Corporation
# Hold users
dn: ou=People,dc=example,dc=com
objectClass: organizationalUnit
ou: People
# All info
dn: ou=Info,dc=example,dc=com
objectclass: organizationalUnit
ou: Info
while i am executing "ldapmodify" command, i am getting above mentioned same error.
Last edited by unibox; 02-14-2012 at 01:36 AM.
|
|
|
|
02-14-2012, 02:06 AM
|
#6
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,364
|
Hi,
If you want to add
Quote:
# All info
dn: ou=Info,dc=example,dc=com
objectclass: organizationalUnit
ou: Info
|
you need to use ldapadd and not ldapmodify
Cheers
|
|
|
|
02-15-2012, 12:11 AM
|
#7
|
|
Member
Registered: Dec 2011
Location: India
Distribution: Centos,redhat,zentyal
Posts: 43
Original Poster
Rep: 
|
Hi bathory thanks for reply
As per your instruction, i tried "ldapadd" also, but i am getting "Already exists" error.
i.e
#ldapadd -v -D "cn=Manager,dc=example,dc=com" -x -W -f /etc/openldap/basic.ldif
ldap_initialize( <DEFAULT> )
Enter LDAP Password:*********
add objectClass:
dcObject
organization
add dc:
example
add o:
Mydomain
add description:
my Corporation
adding new entry "dc=example,dc=com"
modify complete
ldapadd: Already exists (68)
ldap search output:
# ldapsearch -x|less
# extended LDIF
#
# LDAPv3
# base <> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# example.com
dn: dc=example,dc=com
objectClass: dcObject
objectClass: organization
dc: example
o: Mydomain
description: my Corporation
# People, int.leadgen.in
dn: ou=People,dc=example,dc=com
objectClass: organizationalUnit
ou: People
# search result
search: 2
result: 0 Success
|
|
|
|
02-15-2012, 12:54 AM
|
#8
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,364
|
Hi,
As I clearly mentioned in my previous post, you should add only
Code:
dn: ou=Info,dc=example,dc=com
objectclass: organizationalUnit
ou: Info
So put those 3 lines in a ldif file and use ldapadd to import in the ldap
Regards
|
|
|
1 members found this post helpful.
|
02-15-2012, 01:45 AM
|
#9
|
|
Member
Registered: Dec 2011
Location: India
Distribution: Centos,redhat,zentyal
Posts: 43
Original Poster
Rep: 
|
Hi bathory guru thanks a lot.
now i have successfully added those entry's.
i have some doubts:
i want to keep all (OU) entry's in basic.ldif file.
as per your instruction, i have deleted remaining all entry's except "ou=info" entry, then only i can able to imported without any error.
if any possible to execute "ldapadd" command with all entry's(ou=info ou=People) in basic.ldif file.
Last edited by unibox; 02-15-2012 at 01:56 AM.
|
|
|
|
02-15-2012, 02:05 AM
|
#10
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,364
|
Hi,
Quote:
|
if any possible to execute "ldapadd" command with all entry's(ou=info ou=People) in basic.ldif file.
|
The ldapadd is supposed to add entries that do not already exist in the directory, so it quits if it finds an already existing dn
You could use the "-c" switch in ldapadd with your basic.ldif, so it skips the existing entries and add only those that do not exist.
Regards
|
|
|
1 members found this post helpful.
|
02-15-2012, 02:21 AM
|
#11
|
|
Member
Registered: Dec 2011
Location: India
Distribution: Centos,redhat,zentyal
Posts: 43
Original Poster
Rep: 
|
yes it's working..
Today i got the solution for this.
thank you so much.....etc....etc...
|
|
|
|
02-15-2012, 02:37 AM
|
#12
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,364
|
Quote:
Originally Posted by unibox
yes it's working..
Today i got the solution for this.
thank you so much.....etc....etc...
|
You're welcome. You may also mark the thread "Solved" from the thread tools on top of the page
Cheers
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:03 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|