User & File System
Privileges
Understand how users, groups, and permissions control access to files and directories: the foundation of every secure system.
Why Access Control Matters
Every operating system must answer a fundamental question: who is allowed to do what? Without access controls, any user could read, modify, or delete any file on the system: including passwords, financial records, and system configurations.
Understanding Users & Groups
The Access Hierarchy
The Permission Triad: Read, Write, Execute
Reading a Permission String
Octal Notation: The Numeric Shorthand
Each permission bit has a numeric value. The three permission bits for each entity are summed into a single digit:
| Permission | Symbol | Value |
|---|---|---|
| Read | r | 4 |
| Write | w | 2 |
| Execute | x | 1 |
| None | - | 0 |
Authentication vs Authorization
| Aspect | Authentication | Authorization |
|---|---|---|
| Question | Who are you? | What can you do? |
| When | Login / sign-in | After identity is confirmed |
| Mechanism | Passwords, biometrics, MFA | Permissions, ACLs, roles |
| Analogy | Showing your ID at the door | Being allowed into specific rooms |
Special Permission Bits
Beyond Basics: Access Control Lists
Standard Unix permissions are limited to one owner, one group, and others. Access Control Lists (ACLs) extend this by allowing fine-grained rules for specific users or groups beyond the file's owner/group.
How to Set Permissions: Step by Step
Example 1: Decoding a Permission String
Example 2: Changing Permissions
Scenario: You have a script called deploy.sh with current permissions -rw-r--r-- (644). You need to make it executable by the owner only.
Example 3: Shared Directory Setup
Scenario: A team needs a shared folder where everyone can add files, but no one except the file creator (or root) can delete others' files.
Common Mistakes to Avoid
Summary: Permissions at a Glance
| Octal | Symbolic | Meaning | Use Case |
|---|---|---|---|
| 755 | rwxr-xr-x | Owner: full, others: read + exec | Public executables |
| 644 | rw-r--r-- | Owner: read/write, others: read | Config files, documents |
| 700 | rwx------ | Owner: full, others: none | Private scripts, SSH keys |
| 600 | rw------- | Owner: read/write, others: none | Sensitive data files |
| 1777 | rwxrwxrwt | All: full + sticky bit | Shared /tmp directories |
Question 1 of 5
A file has the permission string -rw-r-----. What octal value does this represent?
Question 2 of 5
Which special permission bit allows a program to execute with the file owner's privileges regardless of who runs it?
Question 3 of 5
The principle of least privilege states that a user should have:
Question 4 of 5
On a Linux system, the /tmp directory typically has permissions 1777. What does the leading 1 indicate?
Question 5 of 5
Which command would give the owner read/write/execute, the group read/execute, and others no access to a file?