User Definitions
The /etc/passwd file is the central source of user account information, readable by all users.
Structure
Each line defines one user, with 7 fields separated by colons (:):
username:password_placeholder:UID:GID:comment:home_directory:shell
Example Line:
jsmith:x:1001:1001:John Smith:/home/jsmith:/bin/bash
Field Breakdown
- username: The login name (
jsmith). - password_placeholder: Since modern Linux uses shadow passwords, this field usually contains an
x(or sometimes*), indicating the encrypted password is in/etc/shadow. - UID: User ID number (1001).
- GID: Primary Group ID number (1001).
- comment: Full name or description.
- home_directory: The default starting directory (
/home/jsmith). - shell: The default shell program to run when the user logs in (
/bin/bash). If set to/sbin/nologin, the user cannot log in interactively.