LAB-PERM-03 - Numeric Permissions (Octal)
ACL Permission Management
Numeric Permissions (Octal)
Translate basic rwx patterns into numeric modes such as 644, 755, and 600 so common Linux permission states become recognizable and usable.
30 min INTERMEDIATE LINUX Curriculum-reviewed
Prerequisites
Success criteria
- Convert common rwx states into numeric modes.
- Use numeric chmod in a practice folder without overwriting by accident elsewhere.
Safety notes
- Numeric chmod replaces the full mode, so use it only when you mean the full state.
Part A: The Field Guide
Numeric modes are a faster way to express full permission states.
The point values are:
- read = 4
- write = 2
- execute = 1
You add the values inside each chunk:
7meansrwx6meansrw-5meansr-x4meansr--0means---
So a mode like 755 means:
- owner:
7=rwx - group:
5=r-x - other:
5=r-x
Use Numeric Modes Deliberately
Numeric chmod replaces the full owner, group, and other state in one step. That is powerful, but less surgical than symbolic chmod.
Common beginner-friendly modes
644for a normal readable file755for a typical executable or directory600for a private file
Part B: The Drill Deck
Terminal required: keep everything in a practice folder.
G Guided Step by step - type exactly this and compare the result >
Exercise G1: Create practice files
- Run
mkdir -p ~/perm_lab && cd ~/perm_lab - Run
touch web.txt script.sh secret.key
Exercise G2: Apply the common modes
- Run
chmod 644 web.txt - Run
chmod 755 script.sh - Run
chmod 600 secret.key - Run
ls -l - Match each file to its expected purpose
Exercise G3: Translate one string back to numbers
- Pick one result from
ls -l - Translate the owner, group, and other chunks back into digits
- Confirm that the digit sequence matches the mode you used
S Solo Task described, hints available - figure it out >
Exercise S1: Mental translation
Convert these modes into permission strings for regular files:
744640400775
Exercise S2: Reverse translation
Convert these strings into numeric modes:
-rw-rw-r---rwxr-xr-x-rw-------
M Mission Real scenario - no hints, combine multiple skills >
Mission M1: Set a safe file-and-folder pair
In your sandbox:
- create a folder called
appdir - create a file inside it called
config.txt - set the directory to a mode appropriate for traversal by others but not writing by others
- set the file to a mode appropriate for reading by others but writing only by you
- explain why the directory and file use different numeric modes
If you can do that and explain the difference, octal permissions are becoming practical knowledge instead of just math.