AcademyTerminal Tactics: Survival in the ShellPhase 2: The Iron Gate (Permissions)

Lesson 2: Understanding File Permissions

In Linux, everything is a file, and every file has Permissions. This is the heart of Linux security.

The Three Musketeers: Owner, Group, Others

Every file has three types of people who can interact with it:

  1. Owner (u): Usually the person who created the file.
  2. Group (g): A collection of users with shared access.
  3. Others (o): Everyone else on the system.

The Three Powers: Read, Write, Execute

For each type of person, we can grant or deny:

  • Read (r): Ability to see the contents.
  • Write (w): Ability to change the contents.
  • Execute (x): Ability to run the file (if it's a script or program).

Interactive Mission

Let's look at a real-world example. On a server, the /etc/shadow file contains encrypted passwords. Only the root (admin) user should be able to read it.

booting...

Steps to Complete:

  1. Who are you? Type whoami to confirm you are the root user.
  2. Inspect the target: Use ls -l /etc/shadow to see its permissions. You'll see something like -rw-r-----.
  3. Create your own secure vault: Create a file named secure.txt and make it so only you can read or write to it using chmod 600 secure.txt.

Knowledge Check

Mission Control

Identify your current user

Expected Command

whoami

Check permissions of the shadow file

Create a restricted file