LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   LDIF file in OpenLDAP (https://www.linuxquestions.org/questions/linux-newbie-8/ldif-file-in-openldap-697456/)

bkcreddy17 01-15-2009 05:27 AM

LDIF file in OpenLDAP
 
Hi
I am totally new to OpenLDAP. When i am studying openldap pdf's i find that somefile.ldif contains some entries. For example
Code:

# This is the root of the directory tree
dn: dc=example,dc=com
description: Example.Com, your trusted non-existent corporation.
dc: example
o: Example.Com
objectClass: top
objectClass: dcObject
objectClass: organization
# Subtree for users
dn: ou=Users,dc=example,dc=com
ou: Users
description: Example.Com Users
objectClass: organizationalUnit
# Subtree for groups
dn: ou=Groups,dc=example,dc=com
ou: Groups
description: Example.Com Groups
objectClass: organizationalUnit

This file contains 2 OU's Users and Groups. Should we type all this content manually and execute ldapadd/slapadd command? If i want to add another groub or objects to Users OU, should i prepare another sample.ldif fire or what? It was easy to do it in GUI. But i want it to be done in CUI. My whole doubt is about LDIF file. Please clarify my doubt.Thank's in an advance.

your_shadow03 01-15-2009 06:27 AM

You can add through commandline too as shown below an example:
Code:


ldapadd -H ldap://ldaphost.example.com -x -D "cn=jimbob,dc=example,dc=com"
 -f /tmp/addentry.ldif -w dirtysecret


bkcreddy17 01-15-2009 06:36 AM

should we create the file "/tmp/addentry.ldif" ? should we add entries in that file and we should exwcute it. Is't it? That's my doubt.


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