
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
LDAP Database Management
|
229
An LDIF file is a text file containing a list of attribute/object-class declarations, one
per line: Example 7-5 shows a simple one.
In Example 7-5, we’re defining the organization wiremonkeys.org: we specify its Dis-
tinguished Name, we associate it with the object classes
top, dcObject,and
organization, and finally we specify the organization’s unique domain component
(
wiremonkeys) and name (Wiremonkeys of St. Paul).
To write this record to the database, we issue this command:
ldapadd -x -H ldaps://localhost/ -D "cn=ldapguy,dc=wiremonkeys,dc=org" -W \
-f wiremonkeys_init.ldif
As with most openldap commands, -x specifies simple password authentication, -H
specifies the LDAP server’s URL, -D specifies the DN of the administrator account,
and
-W causes the administrator’s password to be prompted for. The -f option speci-
fies the path to our LDIF file.
Confused yet? I’ve packed a lot of information into this section, but our LDAP server
is very nearly done.
LDAP Database Management
Okay, we’ve installed OpenLDAP, configured slapd, gotten TLS encryption work-
ing, and created our first LDAP record. Now it’s time to add some users and start
using our server—e.g., for authenticating IMAP sessions.
Database Structure
The first step in creating an LDAP user database