Permissions & Users
Every file and program on a Linux system belongs to a user and a group, and every one of them has a set of permissions saying who can read, write, or execute it. Learning how permissions work — and how to switch identity safely with sudo and su — is the single most important safety skill on a Linux system. It is also where most “Permission denied” errors come from, and where mistakes can do real damage.
Why This Section Comes After Navigation and File Ops
By now you can move around the filesystem and look at files. This section adds the other half of the picture: who is allowed to do what. You will learn to read permission strings, change them, run commands as another user, and understand the accounts that make a Linux system tick.
The Model in One Picture
-rw-r--r-- 1 alice staff 4096 Dec 4 10:00 notes.txt
^^^^^^^^^^ ^^^^^ ^^^^^
permissions owner group
- rw- r--
│ │ └── others (everyone else)
│ └────── group
└────────── owner
The nine permission bits answer three questions: what can the owner do, what can the group do, and what can everyone else do? Read, write, and execute are the answers.
Common Permission & User Tools
| Tool | Purpose |
|---|---|
chmod | Change file permissions |
chown | Change file owner and/or group |
chgrp | Change a file’s group |
umask | Set the default permissions for new files |
sudo | Run a single command as another user |
su | Switch your shell to another user |
id | Show who you are and what groups you’re in |
whoami | Print your current username |
passwd | Change a user’s password |
useradd | Create a new user account |
/etc/passwd | The file that stores every account |
Why This Matters
- Understanding permissions explains most “Permission denied” errors — and how to fix them safely instead of blindly reaching for
sudo. sudois how you do administration; knowing when to use it (and when not to) keeps your system safe.- Managing users and groups is a prerequisite for setting up servers, sharing files between people, and running services securely.
- The concepts apply everywhere: Linux, macOS, servers, containers, and cloud instances all use the same permission model.
Start with chmod to understand how permissions are read and changed, then learn the identity commands (id, whoami) and how to switch users with sudo and su.
Rule of thumb: if a command needs
sudo“just to work”, stop and understand why before running it. Most permission errors have a safer, narrower fix than “run everything as root”.