The Account Files

Where Accounts Live

FileHoldsNotable
/etc/passwdUser accountsWorld-readable, no passwords
/etc/shadowPassword hashes + ageingRoot-only
/etc/groupGroup definitionsGroup membership
/etc/gshadowGroup passwords/adminsRoot-only

A /etc/passwd line has 7 colon-separated fields:

alice:x:1001:1001:Alice Smith:/home/alice:/bin/bash
  |   |   |    |       |          |          └ login shell
  |   |   |    |       |          └ home directory
  |   |   |    |       └ GECOS (comment)
  |   |   |    └ primary GID
  |   |   └ UID
  |   └ password placeholder (x = see /etc/shadow)
  └ username
Exam tip: UID 0 = root. System accounts are typically UID < 1000; regular users start at 1000 (Debian/RHEL) - set in /etc/login.defs.