Linux Today: Linux News On Internet Time.

Another Simple Scriptlet To Make The Unix And Linux CLI More User Friendly

Nov 24, 2008, 10:03 (2 Talkback[s])
(Other stories by Mike Tremell)

[ Thanks to Mike Golvach for this link. ]

"Our little foray into variable interpolation today has to do with making /etc/passwd just a bit more accessible. Most folks are familiar with the 7 colon-separated fields of this file (if not, they're: The user's Username, an encrypted password (or usually an "x" if you're using a shadow password system), the user's UID, the user's GID, the user's gecos information (Also referred to as the "comment field," usually either empty or populated with a short description to make the account more easily recognizable) , the user's home directory and, finally, the user's default shell)

"Now, say what you will about the structure and setup of the passwd file, but it's fairly easy to follow. Almost everything in it is the opposite of cryptic. The password field (field number 2) is, of course, not going to be tailored for your ease of understanding ;) If you get really lucky and you hop on a machine that actually lists the encrypted password in field two of /etc/passwd, you can copy the file to any remote machine and go to work on it. We've posted quite a few scripts to do automated password cracking."

Complete Story

Related Stories: