(Answer) (Category) OpenLDAP Faq-O-Matic : (Category) OpenLDAP 1.2 Quick Start Guide : (Answer) Add initial entries to your directory
You use ldapadd(1) to add entries an LDAP directory. LDAP add expects input in LDIF format. Hence, adding entries is done in two steps:
  1) create LDIF file
  2) run ldapadd

Use your favorite editor to create an LDIF format file that contains:

    dn: dc=<MY-DOMAIN>, dc=<COM>
    dc: <MY-DOMAIN>
    o: <MY ORGANIZATION>
    objectclass: organization
    objectclass: dcObject
dn: cn=Manager, dc=<MY-DOMAIN>, dc=<COM> cn: Manager sn: Manager objectclass: person

Be sure to replace <MY-DOMAIN> and <COM> with the appropriate domain components of your domain name. <MY ORGANIZATION> should be replaced with the name of your organization. If you cut and paste, be sure to trim any leading whitespace from the example.

For example:

   dn: dc=mydomain, dc=com
   dc: mydomain
   o: My Company
   objectclass: organization
   objectclass: dcObject
dn: cn=Manager, dc=mydomain, dc=com cn: Manager sn: Manager objectclass: person

Run ldapadd(1) to insert these entries into your directory.
  ldapadd -D "cn=Manager, dc=<MY-DOMAIN>, dc=<COM>" -W < myldif.ldif
Be sure to replace <MY-DOMAIN> and <COM> with the appropriate domain components of your domain name. You will be prompted for the "secret" used in slapd.conf.

For example, for "mydomain.com", use:

  ldapadd -D "cn=Manager, dc=mydomain, dc=com" -W < myldif.ldif

See Also: ldapadd(1)
[Append to This Answer]
Previous: (Answer) Start SLAPD
Next: (Answer) See if it works!
This document is: http://www.openldap.org/faq/index.cgi?file=182
[Search] [Appearance]
This is a Faq-O-Matic 2.719.
© Copyright 2004, OpenLDAP Foundation, info@OpenLDAP.org