This file stores information about users.
Each line in /etc/passwd is in this format:
username:has_pw:userid:group:comment:homedir:shell
Note: The rpcbind server requires both the user and group daemon, and the tftpd server requires both the user and group nobody
The fields are separated by colons and include:
- username
- The user's login name. This can contain any characters except a colon
(:), but you should probably avoid any of the shell's
special characters. For more information, see
Quoting special characters in Using the Command Line.
- has_pw
- This field must be empty or x. If empty, the user has no
password; if x, the user's hashed password is in
/etc/shadow.
- userid
- The numeric user ID.
- group
- The numeric group ID.
- comment
- A free-form comment field that usually contains at least the user's real name;
this field must not contain a colon.
- homedir
- The user's home directory.
- shell
- The initial command to start after login. The default is
/bin/sh.
Note:
You can't specify any arguments to the login program.
Here's a sample entry from /etc/passwd:
fred:x:290:120:Fred L. Jones:/home/fred:/bin/sh