6.1. The /etc/passwd file

The /etc/passwd file is a list of users recognized by the system. The system consults the file at login time to determine a user’s UID and home directory, among other things. Each line in the file represents one user and contains seven fields separated by colons:

  • Login name

  • Encrypted password or password placeholder (see page 96)

  • UID (user ID) number

  • Default GID (group ID) number

  • “GECOS” information: full name, office, extension, home phone

  • Home directory

  • Login shell

For example, the following lines are all syntactically valid /etc/passwd entries:

root:lga5FjuGpZ2so:0:0:The System,,x6096,:/:/bin/shjl:x:100:0:Jim Lane,ECT8-3,,:/staff/jl:/bin/shdotty:$1$Ce8QpAQI$L.DvJEWiHlWetKTMLXFZO/:101:20::/home/dotty:/bin/tcsh ...

Get Linux Administration Handbook, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.