Linux Fundamentals

Permissions & Ownership

Read and set the rwx permission model and understand users, groups, and sudo.

30 min read beginner 3 objectives

Status

Not started

What you will learn

  • Decode rwxr-xr-x
  • Use chmod and chown safely
  • Know when to reach for sudo

New to this? Start here

The basics, in plain English

Every file on a Linux machine has rules about who is allowed to look at it, change it, or run it. These rules are called permissions. They exist so that not everyone can read or break everyone else’s files.

Permission
A rule that says what someone is allowed to do with a file.
Read (r)
Permission to open and look at the contents of a file.
Write (w)
Permission to change or delete a file.
Execute (x)
Permission to run a file as a program (only matters for programs and scripts).
Owner
The user account that the file belongs to, usually whoever created it.
Group
A named set of users who share the same access, like a team.
chmod
A command that changes a file’s permissions ("change mode").
chown
A command that changes who owns a file ("change owner").
01

The permission triad

Every file has owner, group, and other permissions, each a combination of read (4), write (2), execute (1). 755 means rwx for owner, r-x for everyone else.

02

Changing things

chmod changes the mode, chown changes ownership. Prefer symbolic modes (chmod u+x) when intent matters.

Try it yourself

bash
$chmod 644 config.yml
Owner can read and write; everyone else can only read.
$chmod u+x deploy.sh
Add execute permission for the owner so the script can run.
$chown app:app /srv/app
Hand ownership of the folder to the app user and group.
$ls -l deploy.sh
Confirm the new permission bits and owner.
↳ lines explain what each command does — only the commands get copied

Finished this topic?

Mark it done to earn 100 XP and keep your streak alive.