3. Access Control#
This chapter introduces Unix access control: users, groups, permissions, defaults, and bounded permission audits that shape secure command-line work.
Identity: Connect users, groups, UIDs, and GIDs to filesystem access decisions.
Permissions: Read symbolic and octal permission forms and change them deliberately.
Defaults: Use
umaskto reason about permissions assigned to new files.Privilege: Recognize when elevated access is needed and when it is risky.
Permission audits: Compare mode observations with intended policy inside an explicit practice tree.
Chapter Video
How to Modify File Permissions in Bash (9:41) by Microsoft Developer
Hosted on YouTube; property of its original creator, embedded here for educational reference only.
Learning Objectives
By the end of this chapter, you will be able to:
Explain how users, groups, and privileges identify access rights, and create and test a regular and an administrative account on a Linux VM.
Read and change symbolic and octal file permissions.
Predict new-file and new-directory modes using
umask, including its limits.Explain setuid, setgid, and sticky-bit observations without changing system executables.
Audit a student-owned fixture tree and justify targeted permission corrections.
Chapter Flow
Glossary
# |
Term |
Explanation |
|---|---|---|
1 |
User |
An account identity used to own files and run processes. |
2 |
UID |
A numeric user identifier used internally by Unix-like systems. |
3 |
Group |
A collection of users that can share file access. |
4 |
GID |
A numeric group identifier used internally by the system. |
5 |
Root |
The superuser account with administrative privileges. |
6 |
|
A command that runs another command with elevated privileges when authorized. |
7 |
Owner |
The user account associated with a file or directory. |
8 |
Group owner |
The group associated with a file or directory. |
9 |
Permission bits |
The read, write, and execute settings stored for a file. |
10 |
Read permission |
Permission to inspect file contents or list a directory. |
11 |
Write permission |
Permission to modify a file or change entries in a directory. |
12 |
Execute permission |
Permission to run a file as a program or traverse a directory. |
13 |
|
The command used to change file permissions. |
14 |
|
The command used to change file ownership. |
15 |
|
The command used to change group ownership. |
16 |
Octal notation |
A numeric permission form such as |
17 |
Symbolic mode |
A permission form such as |
18 |
|
A mask that removes permissions from newly created files and directories. |
19 |
Special permissions |
Permission bits such as setuid, setgid, and sticky bit. |
20 |
Least privilege |
Using only the access needed for an authorized task. |
21 |
Directory search |
Permission to resolve a child name through a directory. |
22 |
Permission audit |
Comparing observed ownership and modes with an intended access policy. |
23 |
Setuid |
A special bit associated with effective user identity on eligible program execution. |
24 |
Setgid |
A special bit associated with eligible program group identity or directory group inheritance. |
25 |
Sticky bit |
A directory bit restricting entry removal and rename by otherwise permitted users. |
26 |
Regular account |
An everyday login account that is not allowed to use |
27 |
Administrative account |
A login account in the administrative group, used only for tasks that need root. |
28 |
|
The Debian and Ubuntu command that creates an account, its private group, and its home directory. |
29 |
|
The command that changes an existing account, such as appending a group with |
30 |
|
A command that looks up accounts and groups in every configured identity source. |