OpenLDAP Setup Overview
This section provides a quick overview for installing and configuring an OpenLDAP directory. For more details, refer to the following URLs:
- http://www.openldap.org/doc/admin/quickstart.html - The Quick-Start Guide on the OpenLDAP website.
- http://www.tldp.org/HOWTO/LDAP-HOWTO/index.html - The LDAP Linux HOWTO from the Linux Documentation Project.
The basic steps for creating an LDAP server are as follows:
- Install the
openldap,openldap-servers, andopenldap-clientsRPMs.
- Edit the
/etc/openldap/slapd.conffile to specify the LDAP domain and server. Refer to "Editing/etc/openldap/slapd.conf" for more information. - Start
slapdwith the command:service ldap startAfter configuring LDAP, use
chkconfig,/usr/sbin/ntsysv, or the Services Configuration Tool to configure LDAP to start at boot time. For more information about configuring services, refer to Controlling Access to Services. - Add entries to an LDAP directory with
ldapadd. - Use
ldapsearchto determine ifslapdis accessing the information correctly. - At this point, the LDAP directory should be functioning properly and can be configured with LDAP-enabled applications.
Editing
/etc/openldap/slapd.confTo use the
slapdLDAP server, modify its configuration file,/etc/openldap/slapd.conf, to specify the correct domain and server.The
suffixline names the domain for which the LDAP server provides information and should be changed from:suffix "dc=your-domain,dc=com"
Edit it accordingly so that it reflects a fully qualified domain name. For example:
suffix "dc=example,dc=com"
The
rootdnentry is the Distinguished Name (DN) for a user who is unrestricted by access controls or administrative limit parameters set for operations on the LDAP directory. Therootdnuser can be thought of as the root user for the LDAP directory. In the configuration file, change therootdnline from its default value as in the following example:rootdn "cn=root,dc=example,dc=com"
When populating an LDAP directory over a network, change the
rootpwline - replacing the default value with an encrypted password string. To create an encrypted password string, type the following command:slappasswdWhen prompted, type and then re-type a password. The program prints the resulting encrypted password to the shell prompt.
Next, copy the newly created encrypted password into the
/etc/openldap/slapd.confon one of therootpwlines and remove the hash mark (#).When finished, the line should look similar to the following example:
rootpw {SSHA}vv2y+i6V6esazrIv70xSSnNAJE18bb2uLDAP passwords, including the
rootpwdirective specified in/etc/openldap/slapd.conf, are sent over the network unencrypted, unless TLS encryption is enabled.To enable TLS encryption, review the comments in
/etc/openldap/slapd.confand refer to the man page forslapd.conf.For added security, the
rootpwdirective should be commented out after populating the LDAP directory by preceding it with a hash mark (#).When using the
/usr/sbin/slapaddcommand line tool locally to populate the LDAP directory, use of therootpwdirective is not necessary.Only the root user can use
/usr/sbin/slapadd. However, the directory server runs as theldapuser. Therefore, the directory server is unable to modify any files created byslapadd. To correct this issue, after usingslapadd, type the following command:chown -R ldap /var/lib/ldap