The -f option passes the filename. See the details of running ldapadd in
Example 4.3,
"ldapadd with example.ldif"
(page 63).
Example 4.3 ldapadd with example.ldif
ldapadd -x -D cn=Administrator,dc=example,dc=com -W -f example.ldif
Enter LDAP password:
adding new entry "dc=example,dc=com"
adding new entry "ou=devel,dc=example,dc=com"
adding new entry "ou=doc,dc=example,dc=com"
adding new entry "ou=it,dc=example,dc=com"
The user data of individuals can be prepared in separate LDIF files.
Example 4.4, "LDIF
(page 63) adds Tux to the new LDAP directory.
Data for Tux"
Example 4.4 LDIF Data for Tux
# coworker Tux
dn: cn=Tux Linux,ou=devel,dc=example,dc=com
objectClass: inetOrgPerson
cn: Tux Linux
givenName: Tux
sn: Linux
mail: tux@example.com
uid: tux
telephoneNumber: +49 1234 567-8
An LDIF file can contain an arbitrary number of objects. It is possible to pass entire
directory branches to the server at once or only parts of it as shown in the example of
individual objects. If it is necessary to modify some data relatively often, a fine subdi-
vision of single objects is recommended.
4.8.2 Modifying Data in the LDAP Directory
The tool ldapmodify is provided for modifying the data stock. The easiest way to
do this is to modify the corresponding LDIF file then pass this modified file to the
LDAP server. To change the telephone number of colleague Tux from +49 1234
567-8 to +49 1234 567-10, edit the LDIF file like in
Example 4.5, "Modified
LDIF File tux.ldif"
(page 64).
LDAP—A Directory Service
63
Need help?
Do you have a question about the LINUX ENTERPRISE SERVER 11 - SECURITY and is the answer not in the manual?
Questions and answers