OpenLDAP Faq-O-Matic : OpenLDAP 1.2 Quick Start Guide : 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 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 | |
Run ldapadd(1) to insert these entries into your directory.ldapadd -D "cn=Manager, dc=<MY-DOMAIN>, dc=<COM>" -W < myldif.ldifBe 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: | Start SLAPD |
Next: | See if it works! |
|