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 NFSdn: ou=people,dc=example,dc=comobjectclass: organizationalUnitou: peopledescription: Usersdn: uid=ldapadm,ou=people,dc=example,dc=comobjectClass: inetOrgPersonobjectClass: posixAccountobjectClass: shadowAccountcn: LDAP admin accountuid: ldapadmuidNumber: 1002gidNumber: 100homeDirectory: /etc/ldaploginShell: /bin/false■ Note The LDAP user cannot log in directly, because the login shell is set to /bin/false. This is a securitymeasure. Alternatively, you could make objectClass be simpleSecurityObject instead of posixAccount.To add this file, use ldapadd:ldapadd -x -D "cn=admin,dc=example,dc=com" -W -f setup.ldif-W is the flag that causes the password to be demanded; -x uses an anonymous bind, because you’renot set up yet to use Kerberos. -ZZ would invoke TLS, which works on all the LDAP admin commands(ldapadd, ldapsearch, and so on).After this, edit /etc/ldap/slapd.conf again to remove (or comment out) the rootdn and rootpwentries. From now on, to add, delete, or modify entries, you can authenticate via Kerberos using kinitldapadm.Restart slapd with /etc/init.d/slapd restart.Testing!Before you fully populate the database, check that it works! Try the following, first from the server. Oncethat’s working, set up a client and try it from there.• ldapsearch -x -H ldaps://server.example.com (-x gives simple bind)• ldapsearch -x -H ldap://server.example.com -ZZ (to test TLS startup)• ldapsearch -x -H ldaps://server.example.com -ZZ -TLS• kinit username; ldapsearch -H ldaps://server.example.com (to testKerberos auth)34Download at WoweBook.Com

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

Saved successfully!

Ooh no, something went wrong!