Suggested day 1320–30 minutesOptional admin

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.

Outcome: You understand who owns a file without needing to create or delete real users.

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

1

Who am I?

Read-only

Shows your username, IDs, and groups.

Terminal
cd ~/linux-practice
whoami
id
groups
2

Inspect ownership

Read-only

Shows ownership on your file and reads user/group databases.

Terminal
touch owned-by-me.txt
ls -l owned-by-me.txt
head -5 /etc/passwd
head -5 /etc/group
3

Optional admin ownership examples

Admin

These change real system state. They are explained, not required for this safe course.

Terminal
sudo chown username:groupname file.txt
sudo adduser testlearner
sudo userdel -r testlearner

Checkpoint

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?

Shortcuts:Alt + ← previous lessonAlt + → next lessonAlt + H home? focus search