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 NFSThen for any individual user, you can create the following ldapmodify file:dn: cn=username,ou=People,dc=example,dc=comchangetype: modifydelete: userPasswordMake sure to replace userPassword with whatever field showed up in your query. Then run this:kinit ldapadm; ldapmodify -f modifyfileYou can put multiple users in the same file. Use the previous syntax, but separate each instance witha blank line. To generate a modify file with just the DN of all your users, use this search:ldapsearch ("userPassword=*") dn > modifyfileYou’ll need to edit it a bit to remove the extraneous query information. On a single-user database,the output looks like this:# extended LDIF## LDAPv3# base with scope subtree# filter: (uid=jkemp)# requesting: dn## jkemp, People, example.comdn: uid=jkemp,ou=People,dc=example,dc=com# search resultsearch: 5result: 0 Success# numResponses: 2# numEntries: 1All you want is the dn: uid=jkemp,ou=People,dc=example,dc=com line. In vim, the followingcommand line::%s/^#.*\n//will remove all the lines beginning with #, leaving only the search result section to delete by hand.Then add this after each dn line in the file:changetype: modifydelete: userPasswordIn vim, the following command line will do this::%s/\(^dn:.*\n\)/\1changetype: modify\rdelete: userPassword/37Download at WoweBook.Com

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

Saved successfully!

Ooh no, something went wrong!