07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

and so on). The answer to the “common name” question must be the fully-qualified hostname<br />

for the LDAP server; in our case, ldap.falcot.com.<br />

This command creates a certificate in the newcert.pem file; the corresponding private key is<br />

stored in newkey.pem.<br />

Now these keys have to be installed in their standard location:<br />

# mv newkey.pem /etc/ssl/private/ldap-key.pem<br />

# chmod 0600 /etc/ssl/private/ldap-key.pem<br />

# mv newcert.pem /etc/ssl/certs/ldap-cert.pem<br />

The slapd daemon also needs to be told to use these keys for encryption; this involves adding<br />

the following directives to the /etc/ldap/slapd.conf file:<br />

# TLS support<br />

TLSCipherSuite HIGH<br />

TLSCertificateFile /etc/ssl/certs/ldap-cert.pem<br />

TLSCertificateKeyFile /etc/ssl/private/ldap-key.pem<br />

Example 11.32<br />

Configuring slapd for encryption<br />

The last step for enabling encryption involves changing the SLAPD_SERVICES variable in the<br />

/etc/default/slapd file. We'll play it safe and disable unsecured LDAP altogether.<br />

# Default location of the slapd.conf file<br />

SLAPD_CONF=<br />

# System account to run the slapd server under. If empty the server<br />

# will run as root.<br />

SLAPD_USER=<br />

# System group to run the slapd server under. If empty the server will<br />

# run in the primary group of its user.<br />

SLAPD_GROUP=<br />

# Path to the pid file of the slapd server. If not set the init.d script<br />

# will try to figure it out from $SLAPD_CONF (/etc/ldap/slapd.conf)<br />

SLAPD_<strong>PI</strong>DFILE=<br />

# Configure if the slurpd daemon should be started. Possible values:<br />

# - yes: Always start slurpd<br />

# - no: Never start slurpd<br />

# - auto: Start slurpd if a replica option is found in slapd.conf<br />

# (default)<br />

Chapter 11 — Network Services: Postfix, Apache, NFS, Samba, Squid, LDAP<br />

293

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!