Mission 2 of 5
File Permissions Deep Dive
Make a script executable without opening access unnecessarily.
Read and change permissions on practice files while learning what system-level permission bits mean.
Mental model
Understand what is happening
r=read, w=write, x=execute.
Owner, group, and others each have permissions.
Directories need x permission to enter.
Guided lab
Work through the mission
Practice chmod
Changes permissions on your own practice file.
cd ~/linux-practice
touch permissions_demo.txt
chmod 644 permissions_demo.txt
ls -l permissions_demo.txt
chmod 600 permissions_demo.txt
ls -l permissions_demo.txtMake a script executable
Adds execute permission to a practice script.
echo 'echo Hello' > scripts/hello.sh
chmod +x scripts/hello.sh
./scripts/hello.shSystem special bits example
These examples explain SUID and sticky bit. Do not run them; Ubuntu already manages system permissions.
chmod u+s /usr/bin/passwd
chmod +t /tmpCheckpoint
Verify the mission
ls -l shows the intended bits and the script runs directly.
Try it yourself
One step without a recipe
Create secret.txt and set it to 600. Create public.txt and set it to 644.
Need a hint?
When in doubt about permissions, go more restrictive, not less. `chmod 644` for files you want others to read. `chmod 600` for files that should stay private. `chmod 700` for directories you want to enter but keep closed to others. Resist the urge to use 777 — it's almost never the right answer.
Explain it back
Before you move on
- What number represents read permission?
- Why is chmod 777 usually a bad habit?