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 NFSThe sufficient line enables local login (for example, by root) if necessary (for example, if there arenetwork problems). At least one line in common-auth must be required, or you will be able to log inwithout a password!The use_first_pass and try_first_pass options mean that you get asked for your password onlyonce, whichever module is used—the second module to attempt authentication will use the alreadyentered password. ignore_root means that the Kerberos module is not used for root login and improvessecurity.To set up ssh login, edit /etc/ssh/sshd_config to set the various Kerberos options (edit these lines ifalready present; add them if not):KerberosAuthentication yesKerberosOrLocalPasswd yesKerberosTicketCleanup yesUsePAM yesAllowTcpForwarding yesGSSAPIAuthentication yesGSSAPICleanupCredentials yesGssapiKeyExchange yesThen edit /etc/ssh/ssh_config (not sshd_config!) to set these lines:GSSAPIAuthentication yesGSSAPIDelegateCredentials yesMake these edits on both the server and the client side. (In practice, therefore, just make the editsfor every machine in your network that you use ssh to or from.) Then restart the ssh server (on allmachines you’ve edited) with sudo /etc/init.d/sshd restart after you’ve made the configurationchanges.You need to add the client host to the keytab on the client so that ssh can transfer the Kerberoscredentials. From the client, run kadmin -p krbadm, which authenticates you to the admin server as theadmin user and connects you to the admin server. Then execute these commands:kadmin: addprinc -randkey host/client.example.comkadmin: ktadd host/client.example.comThe -randkey option generates a random key rather than asking for a password, and this ispreferable for a nonperson entity like a machine, meaning that the key is stored locally and used todecrypt a granted TGT, rather than a password having to be entered. The ktadd line adds the server keyto the local default keyfile (/etc/krb5.keytab).Create a test user, still using kadmin:kadmin: addprinc test@EXAMPLE.COM27Download at WoweBook.Com

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

Saved successfully!

Ooh no, something went wrong!