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

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

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

CHAPTER 2 ■ CENTRALIZING YOUR NETWORK: KERBEROS, LDAP, AND NFSand provide backup, as described in recipe 2-9. After getting the TGT request, the KDC looks up the user(referred to as the principal) in its database, retrieves their key, and then sends back a TGT encryptedwith that key. The client machine then uses the user’s password to decrypt the TGT, thus authorizing it.The important point here is that, like PGP encryption, this is an asymmetrical process. The passworddoesn’t get sent over the network: it’s just used locally. So, it’s not vulnerable to any kind of networkintercept, providing a massive security boost.After the TGT has been sent, it’s stored locally, and any Kerberized service will use it to ask for aservice-specific ticket. It proves who the user is, so they don’t need to enter their password again untilthe TGT expires (usually after ten hours) or is manually deleted. So, if your entire system is Kerberosauthenticated, you can log on once and then ssh to any system without having to reauthenticate. It’s notonly more secure but also easier to use!The process works very similarly for services or machines—except that a locally stored key is used toauthenticate nonpeople principals, instead of a password.■ Note If you want more information, there’s an excellent and very readable explanation of how Kerberos worksat http://web.mit.edu/kerberos/www/dialogue.html.2-1a. Server Installation and ConfigurationLog into the machine you want to use as your Kerberos server—let’s call it kerberos.example.com.Kerberos packages should be available for any major distribution (or you can of course compile fromsource, but I won’t cover that here). For Debian/Ubuntu, you’d use this:sudo apt-get install krb5-kdc krb5-admin-server libkrb5-dev krb5-config krb5-userkrb5-clients libkadm55■ Note This recipe uses the MIT version of Kerberos. The other main implementation available is Heimdal(originally developed as a non-U.S. version back when there were legal issues with the U.S.-based MIT versionbeing exported, which is no longer the case). MIT’s version is more widely used and slightly more active indevelopment terms. Windows and Java also come with their own versions of Kerberos, and other freeimplementations are available.During the installation of the packages, you’ll be asked for a couple of pieces of information. One isthe realm to use for krb5-config. This will usually be the uppercase version of the local DNS domain. So,for the example.com domain, the realm would be EXAMPLE.COM. You don’t need Kerberos v4 compatibility.If asked for the hostname of your server, this should be the fully qualified domain name (FQDN) of yourserver, so in this example it’s kerberos.example.com.Next you need to create your new realm using the krb5_newrealm command. You’ll be asked for amaster password. You should use a strong passphrase, and do not forget it because if you lose both thispassword and the stash file that Kerberos creates with it, you can’t decrypt your database again.22Download at WoweBook.Com

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

Saved successfully!

Ooh no, something went wrong!