Mission 3 of 5
Ownership and Groups Without Fear
Explain who owns a file and when ownership changes require care.
Learn users, groups, ownership, and why admin ownership commands are optional rather than required.
Mental model
Understand what is happening
Every file has an owner and group.
Your regular account should own practice files.
sudo changes the risk level.
Guided lab
Work through the mission
Who am I?
Shows your username, IDs, and groups.
cd ~/linux-practice
whoami
id
groupsInspect ownership
Shows ownership on your file and reads user/group databases.
touch owned-by-me.txt
ls -l owned-by-me.txt
head -5 /etc/passwd
head -5 /etc/groupOptional admin ownership examples
These change real system state. They are explained, not required for this safe course.
sudo chown username:groupname file.txt
sudo adduser testlearner
sudo userdel -r testlearnerCheckpoint
Verify the mission
id and ls -l explain current ownership.
Try it yourself
One step without a recipe
Use ls -l and identify owner and group columns. Use id and identify your primary group.
Need a hint?
If a tutorial tells you to run `sudo chown root:root /some/file`, stop and ask why. Most of the time, you don't need to change ownership at all. Your files belong to you. That's the default and it's correct. Only reach for `sudo chown` when you actually understand what's wrong.
Explain it back
Before you move on
- Which command shows your user and group IDs?
- Why are adduser/userdel not part of the core safe path?