Files

Monday, January 24, 2011

/etc/passwd

The /etc/passwd file is a text file with one record per line, each describing a user account. Each record consists of seven fields separated by colons. The ordering of the records within the file is generally unimportant.

An example record may be:

jsmith:x:1001:1000:John Smith,Room 500,(456)111-20,(456)111-44,email:/home/jsmith:/bin/sh

The fields, in order from left to right, are:

  1. The first field is the user name, i.e. the string a user would type in when logging into the operating system: the logname. Each record in the file must have a unique user name field.
  2. The second field stores information used to validate a user's password; however in most modern uses this field is usually set to "x" (or some other indicator) with the actual password information being stored in a separate shadow password file. Setting this field to an asterisk "*" is the typical way to deactivate an account to prevent it being used.
  3. The third field is the user identifier (UID), the number that the operating system uses for internal purposes. It does not have to be unique.
  4. The fourth field is the group identifier(GID). This number identifies the primary group of the user; all files that are created by this user may initially be accessible to this group.
  5. The fifth field, called the Gecos field, is commentary that describes the person or account. Typically, this is a set of comma-separated values including the user's full name and contact details.
  6. The sixth field is the path to the user's home directory.
  7. The seventh field is the program that is started every time the user logs into the system. For a interactive user, this is usually one of the system's command line interpreters (shells).

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home