Example 36.7 Example for an LDIF File
# The Organization
dn: dc=example,dc=com
objectClass: dcObject
objectClass: organization
o: Example dc: example
# The organizational unit development (devel)
dn: ou=devel,dc=example,dc=com
objectClass: organizationalUnit
ou: devel
# The organizational unit documentation (doc)
dn: ou=doc,dc=example,dc=com
objectClass: organizationalUnit
ou: doc
# The organizational unit internal IT (it)
dn: ou=it,dc=example,dc=com
objectClass: organizationalUnit
ou: it
IMPORTANT: Encoding of LDIF Files
LDAP works with UTF-8 (Unicode). Umlauts must be encoded correctly. Use
an editor that supports UTF-8, such as Kate or recent versions of Emacs. Other-
wise, avoid umlauts and other special characters or use recode to recode the
input to UTF-8.
Save the file with the .ldif suffix then pass it to the server with the following com-
mand:
ldapadd -x -D <dn of the administrator> -W -f <file>.ldif
-x switches off the authentication with SASL in this case. -D declares the user that
calls the operation. The valid DN of the administrator is entered here just like it has
been configured in slapd.conf. In the current example, this is
cn=Administrator,dc=example,dc=com. -W circumvents entering the pass-
word on the command line (in clear text) and activates a separate password prompt.
This password was previously determined in slapd.conf with rootpw. -f passes
the filename. See the details of running ldapadd in Example 36.8, "ldapadd with ex-
ample.ldif" (page 681).
680
Installation and Administration
Need help?
Do you have a question about the LINUX ENTERPRISE SERVER 10 SP2 - INSTALLATION AND ADMINISTRATION and is the answer not in the manual?
Questions and answers