Permission Denied: Fix It Without Root
MediumLinux Fundamentals15-20 minYou are logged in as 'student' — an ordinary account with NO sudo. Your prompt ends in $, not #. Three things in your home directory won't work, and every one is a permission problem you can fix yourself, because you OWN these files. There is no root to call and no sudo to run; the whole point is that owning a file is enough.
1. 'My deploy script won't run.' ~/bin/deploy.sh exists, but ./bin/deploy.sh says 'Permission denied'. Look at its mode.
2. 'I can't even read my own handoff notes.' cat ~/notes/handoff.txt says 'Permission denied' — on a file you own. You cannot read it right now, yet you can still fix it. Why?
3. 'My log file is right there but I can't open it.' ~/logs/service.log exists and is readable, but cat ~/logs/service.log fails. The problem isn't the file — it's the directory in the way.
Diagnose with ls -l and stat, then fix each with chmod. This is the everyday unprivileged-user loop: hit EPERM, read the mode, reason about who you are, fix what you own.
- Make ~/bin/deploy.sh executable by you (you can run it)
- Restore your read access to ~/notes/handoff.txt (you own it, so you can)
- Fix ~/logs so you can open the log file inside it
Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.
