
Chapter 19. Lightweight Directory Access Protocol (LDAP) 253
Caution
You should not modify any of the schema items defined in the schema files installed by OpenLDAP.
You can extend the schema used by OpenLDAP to support additional attribute types and object
classes using the default schema files as a guide. To do this, create a local.schema file in the
/etc/openldap/schema directory. Reference this new schema within slapd.conf by adding the
following line below your default include schema lines:
include /etc/openldap/schema/local.schema
Next, go about defining your new attribute types and object classes within the local.schema file.
Many organizations use existing attribute types and object classes from the schema files installed by
default and modify them for use in the local.schema file. This can help you to learn the schema
syntax while meeting the immediate needs of your organization.
Extending schemas to match certain specialized requirements is quite involved and beyond the scope
of this chapter. Visit http://www.openldap.org/doc/admin/schema.html for information on writing new
schema files.
19.7. OpenLDAP Daemons and Utilities
The OpenLDAP package includes two daemons: slapd and slurpd.
The slapd daemon is the stand-alone LDAP daemon, which you will need to run to support LDAP.
The slurpd daemon controls the replication of LDAP directories over a network by sending changes
from the master LDAP directory to slave LDAP directories. You will not need to run slurpd unless
you have more than one LDAP server on your network. If you have two or more LDAP servers,
slurpd will keep the various LDAP directories in sync.
OpenLDAP also includes some utilities in /usr/bin for adding, modifying and deleting entries in an
LDAP directory:
• ldapmodify — Modify entries in an LDAP database, accepting input via a file or standard input.
• ldapadd — Adds entries to your directory, accepting input via a file or standard input; ldapadd
is actually a hard link to ldapmodify -a.
• ldapsearch — Searches for entries in the LDAP directory using a shell prompt.
• ldapdelete — Deletes entries from an LDAP directory, accepting input via a file or a shell
prompt.
With the exception of ldapsearch, each of these utilities is much more easily used by referencing
a file with the changes to be made rather than typing the commands one after the other. Each of their
respective man pages covers the syntax of these files.
To import or export blocks of information with a slapd directory or perform similar administrative
tasks, different utilities, located in /usr/sbin, are required:
• slapadd — Adds entries from an LDIF file to an LDAP directory. For example, execute
/usr/sbin/slapadd -l ldif where ldif is the name of the LDIF file containing the new
entries.
• slapcat — Pulls entries out of an LDAP directory and saves them in an LDIF file. For example,
execute /usr/sbin/slapcat -l ldif where ldif is the name of the target LDIF file to contain
the entries from the LDAP directory.
Commenti su questo manuale