Specifications
Using LDIF Files
Lightweight Directory Interchange Format (LDIF) is a le format used to represent
LDAP entries in text form. LDAP tools such as ldappadd, ldapmodify, and ldapsearch
read and write LDIF les.
Here is an example of an LDIF le containing three entries. Multiple entries in an LDIF
le are separated by blank lines.
dn: cn=Mei Chen,dc=example,dc=com
cn: Mei Chen
cn: M Chen
objectclass: person
description:< file:///tmp/babs
sn: Chen
dn: cn=Anne Johnson,dc=example,dc=com
cn: Anne Johnsone
cn: A Johnson
objectclass: person
sn: Johnson
dn: cn=Tom Clark,dc=example,dc=com
cn: Tom Clark
cn: T Clark
objectclass: person
sn: Clark
WARNING: LDAP tools can modify or add entries to the LDAP directory. Changing
raw data in a directory can have unexpected and undesirable consequences. You
could inadvertently incapacitate users or computers, or you could unintentionally
authorize users to access more resources.
To load an LDIF le into the LDAP directory:
Replace m appleserver.example.com with the location of the LDAP directory and
myusers.ldif with the name of your LDIF le:
$ ldapadd -H ldap://appleserver.example.com -f myusers.ldif
204 Chapter 9 Maintaining Open Directory Services