Chapter 5. Users, Groups, and File Permissions

Every act of administration on a Debian system happens inside an identity. The kernel decides what a process may read, write, execute, open, and listen on by comparing the numeric user and group IDs attached to that process against the ownership recorded on each file. Names, passwords, home directories, and group memberships are the accounting layer on top of those numbers, and keeping that layer consistent is most of what "managing access" means on a single machine.

This chapter covers the local identity machinery end to end: how accounts are stored and resolved, how they are created, changed, locked, and removed, how file permissions and ACLs translate identities into access, how administrative work is delegated with sudo, and how PAM connects every login path - console, SSH, su, sudo - to the same password and session policy. Centralized identity services are a later subject (Chapter 35); everything here applies to the local account databases that such services extend rather than replace.

The examples run on the same Debian 13.7 amd64 system named trixie used throughout the book, and the conventions follow Chapter 3: commands entered in an ordinary user's shell begin with $, commands entered in a root shell begin with #, and the marker is documentation that is not typed. Each console block shows one complete command followed by its own output; [...] marks lines omitted from a longer output; timestamps, process identifiers, and dates on your system will differ. When more than one account is involved, the prose states whose shell each block runs in - john's, sam's, or the root shell - and reidentifies the target whenever it changes.

Two accounts beyond the reader's own appear throughout, and one disposable account appears in the lifecycle section:

Account Home directory Role in this chapter
john /home/john The reader's ordinary account, established in Chapter 2.
sam /home/sam A second human account, john's teammate in the shared examples.
tempuser /home/tempuser A disposable account for the lock, expiry, and removal demonstrations.

Practice files live under john's workspace /home/john/debian-handbook/accounts-permissions, following the pattern from Chapter 3, and the shared examples use a purpose-made directory under /srv rather than anyone's home, for the reason Section 5.1.3 makes explicit.

In this section