RedTeam Nexus Labs
Module 04 · Lesson 01 // Permissions

rwx

Permissions · Linux

Freereading · 10 min
On this page
LESSON

Overview

Linux controls access to every file and directory with a compact set of read, write, and execute permissions applied to three classes of users. This rwx model is the heart of Linux security. This lesson explains what the permissions mean and how to read them.

Learning objectives

  • Explain the read (r), write (w), and execute (x) permissions.
  • Identify the three permission classes: owner, group, other.
  • Read a permission string from ls -l.

Core concept

Each file and directory has permissions for three classes:

  • Owner (user) — the file's owning user.
  • Group — the file's owning group.
  • Other — everyone else.

For each class there are three permissions:

  • r (read) — view file contents (or list a directory).
  • w (write) — modify a file (or create/delete entries in a directory).
  • x (execute) — run a file as a program (or enter/traverse a directory).

How it works

ls -l shows a 10-character string like -rwxr-xr--. The first character is the file type (- file, d directory); the next nine are three rwx triplets for owner, group, and other in that order. A letter means the permission is granted, a dash - means it is denied. Crucially, on directories the meanings shift: r lists names, w allows adding/removing entries, and x allows entering the directory and accessing items within it.

Practical example

$ ls -l script.sh
-rwxr-xr-- 1 alice devs 512 Sep 21 10:00 script.sh

Reading the triplets: owner (alice) has rwx (read, write, execute); group (devs) has r-x (read, execute, no write); other has r-- (read only). So Alice can edit and run the script, group members can read and run it, and everyone else can only read it.

Cybersecurity relevance

Permissions are the primary access-control mechanism on Linux, so reading them fluently is essential. Over-permissive settings — especially world-writable (w for other) or files granting more access than needed — are common findings that enable tampering or privilege escalation. On directories, an unexpected w for others can let attackers plant or replace files. Enumerating permissions on sensitive files (config, keys, scripts) is a routine part of both hardening and assessment.

Common mistakes

  • Reading the triplets in the wrong order — it is always owner, then group, then other.
  • Applying file meanings to directories — on directories, x means "enter/traverse" and w means "add/remove entries."
  • Ignoring world-writable permissions, a frequent and dangerous misconfiguration.

Key takeaways

  • Permissions apply r (read), w (write), x (execute) to three classes: owner, group, other.
  • ls -l shows type + three rwx triplets (owner/group/other); a letter grants, a dash denies.
  • On directories the meanings shift (r=list, w=add/remove, x=enter); over-permissive settings like world-writable are key security findings.

Check your understanding

  • In -rwxr-x---, what can the owner, the group, and others each do?
  • How does the meaning of the x permission differ between a regular file and a directory?
FINISH THIS LESSON

Sign in to save your progress.