Skip to content

πŸ•ΆοΈ Technique Card: Understanding Access Permissions on Linux

Unit 101 – Terminal Tigers 🐯 | Rank: Shadow Recruit

ShadowNet Agency: Recruit Training File – Classified Level 1


πŸ•΅οΈ Intel Drop: Who Can Do What?

Every file in a Linux system has access permissions that control who can read, write, or execute it. These permissions are divided into three sets:

  • πŸ‘€ User (u) – The file’s owner
  • πŸ§‘β€πŸ€β€πŸ§‘ Group (g) – Users in the same group as the file
  • 🌍 Others (o) – Everyone else on the system

Each set can have three permissions:

Symbol Meaning Value
r Read (view) 4
w Write (edit) 2
x Execute (run) 1

πŸ”’ The Numbers Game

Linux lets us use numbers to represent these permissions:

chmod 755 file.txt

Here’s how it breaks down:

  • 7 = 4 (r) + 2 (w) + 1 (x) β†’ rwx
  • 5 = 4 (r) + 0 (no w) + 1 (x) β†’ r-x
  • Another 5 for others β†’ r-x

So chmod 755 means:

User:  rwx
Group: r-x
Others: r-x

Try it out:

touch testfile
chmod 741 testfile
ls -l testfile

What do you see?


πŸ§ͺ Investigating a File

Use this command to see file permissions:

ls -l filename

Example output:

-rwx--x--- 1 agentY evilagents 532 Apr 13 09:00 stealth_script.sh

Breakdown:

  • -rwx--x--- β†’ permissions
  • agentY β†’ owner
  • evilagents β†’ group

πŸ” Who’s in the Group?

To see who is in a group:

grep evilagents /etc/group

Or:

getent group evilagents

πŸ§‘β€πŸ’» System vs User Accounts

  • User accounts: Created for humans like you! They usually have home directories (e.g., /home/sr101).
  • System accounts: Created for services, scripts, or stealthy purposes. They might not have a home directory or login shell.

Spot them in /etc/passwd. A system account might look like this:

stealthsvc:x:999:998::/var/lib/stealthsvc:/usr/sbin/nologin

Notice the lack of a home and the non-login shell.


πŸ”§ Changing Permissions

Use chmod to change file permissions:

sudo chmod 700 file.sh          # Numeric version: rwx --- ---

Need help breaking it down? Use this memory tip:

Read = 4, Write = 2, Execute = 1

Add them up for the permissions you want!


🎯 Practice Drill

  1. Create a file with:
touch recruit_file
chmod 731 recruit_file
ls -l recruit_file
  1. Interpret what those numbers mean.

Keep your eyes open, recruits. Not every account on the system is what it seems…

Trust your tools. Decode the clues. Silence the threat.


⬅️ Go to Mission 005: The Execution Key


Watch the video