13.07.2015 Views

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 2 ■ CENTRALIZING YOUR NETWORK: KERBEROS, LDAP, AND NFSThese are the stages of an LDAP request:1. The client asks the server for a particular piece of information.2. The server runs the appropriate search (for example, finds the entry for agiven UID).3. The server returns the requested information (an entry or part of an entry) tothe client.LDAP can run either securely (using SSL on port 636 as ldaps:/// or using TLS over port 389 asldap:///) or otherwise (on port 389 as ldap:/// but without TLS). This recipe covers both, but it’s best touse secure LDAP unless you have a good reason to do otherwise.2-3a. OpenSSLOpenSSL enables you to run a secure LDAP server. For Debian/Ubuntu, run the following to install it:> sudo apt-get install libssl-dev openssl ca-certificates libssl0.9.8You have two options for getting a certificate:• Contact VeriSign or another certificate authority to sign your certificate. In thiscase, you’ll need only step 2 of the following process; follow your certificateauthority’s (CA’s) instructions about what to do with the request you produce.• Generate a self-signed certificate. If you’re going to use your certificate outside ofyour own network, it’s best to get a proper CA to sign it. If it’s just for local use,self-signing is fine (and free!).To generate a self-signed certificate, follow these steps (for a CA certificate, use step 2 without the -x509 option):1. First generate a certificate authority:> cd /etc/ssl> sudo /usr/lib/ssl/misc/CA.sh –newcaThe script requires various inputs. You’ll need a (secure) PEM passphrase(make sure you remember it!). The other important value is the common name(CN), which must match the FQDN of the certificate authority server (here, I’musing the LDAP server to be its own certificate authority, so the value isldapserver.example.com):Common Name (eg, YOUR name) []: ldap.example.comLeave the challenge password attribute empty.2. Create the certificate:openssl req -new -x509 -nodes -out newreq.pem -keyout newreq.pem -days 36529Download at WoweBook.Com

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

Saved successfully!

Ooh no, something went wrong!