Example 36.10 Modified LDIF File tux.ldif
# coworker Tux
dn: cn=Tux Linux,ou=devel,dc=example,dc=com
changetype: modify
replace: telephoneNumber
telephoneNumber: +49 1234 567-10
Import the modified file into the LDAP directory with the following command:
ldapmodify -x -D cn=Administrator,dc=example,dc=com -W -f tux.ldif
Alternatively, pass the attributes to change directly to ldapmodify. The procedure
for this is described below:
1 Start ldapmodify and enter your password:
ldapmodify -x -D cn=Administrator,dc=example,dc=com -W
Enter LDAP password:
2 Enter the changes while carefully complying with the syntax in the order presented
below:
dn: cn=Tux Linux,ou=devel,dc=example,dc=com
changetype: modify
replace: telephoneNumber
telephoneNumber: +49 1234 567-10
Find detailed information about ldapmodify and its syntax in the ldapmodify
man page.
36.4.3 Searching or Reading Data from an
LDAP Directory
OpenLDAP provides, with ldapsearch, a command line tool for searching data
within an LDAP directory and reading data from it. A simple query would have the
following syntax:
ldapsearch -x -b dc=example,dc=com "(objectClass=*)"
LDAP—A Directory Service
675