Account Databases and Service Users
Quick answer
Account databases describe users and groups; they do not prove that a person has logged in. Use synthetic records to learn their structure without exposing password hashes or private account data.
Prepare the practice environment
Use the chapter fixture described in lab-fixtures/users/README.md. Run setup as a normal user in a disposable Linux environment, enter the printed directory, check pwd, and run export LC_ALL=C; umask 022. Every local example assumes a fresh fixture; examples explicitly marked VM ONLY require an authorized snapshot-backed VM and must not be run in the ordinary fixture. Commands omit the terminal prompt; outputs below are not commands.
How it works
A typical local passwd record has seven colon-delimited fields: name, password marker, UID, primary GID, comment, home and shell. A group record has four: name, password marker, GID and explicit member list. Primary group membership need not appear in that list. On shadow-based systems, /etc/shadow holds restricted password verifiers and aging information; an x marker is not a password. Service accounts commonly isolate daemons; their shells may deny interactive login, but a shell setting alone does not remove all ways to use an identity. UID ranges and account defaults are distribution-specific.
In the fictional files, follow the primary GID in the passwd row to the matching numeric GID in group.sample. Then inspect explicit supplementary members separately. The two relationships are not interchangeable. A missing username from the explicit member list does not disprove its primary membership. Treat a service account shell as one control, not a complete account security policy.
Try the examples
awk -F: '$1 == "bmreader" {print $1, $3, $4, $6, $7}' passwd.sampleThe third and fourth fields are numeric IDs, not file modes. This file is a fixture, not /etc/passwd.
Expected stdout:
bmreader 21001 21010 /home/bmreader /bin/bashThe matching GID connects the user to its primary group even if field four is empty.
Expected stdout:
bmreaders 21010This synthetic service account has a non-login shell; do not infer its real privileges from that field alone.
Expected stdout:
bmsvc /usr/sbin/nologinCommon mistakes
Never print, copy or attempt to read shadow password records for a tutorial. Avoid manually editing account files; use approved administration tools and backups.
Practice
From the fixture, explain the difference between the bmreader primary group and the supplementary bmaudit member list. Identify the service account and explain why its password marker does not establish login ability.
Related references
Study: getent. These are reference names, not deployed links.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Account databases and service users — Knowledge Check
Apply the lesson concepts to the controlled account fixture.
Which passwd field identifies the primary group?
What does x in a typical shadow-based passwd record mean?
Where can primary membership be found even if the group member list is empty?
Does a nologin shell alone prove an account cannot run services?