File Permissions Fundamentals: Decoding Linux Access Controls
Learn to read Linux file permissions strings. Master the 'rwx' format for owners, groups, and others to secure your server and control file access effectively.

Previously in this course, we covered Understanding Users and Groups in Linux, where you learned how the system categorizes actors. This lesson builds on that foundation by teaching you how the system enforces rules on what those users can actually do with files.
The Anatomy of a Permission String
When you run ls -l (which we explored in Listing and Inspecting Files), you see a ten-character string at the beginning of each line. This is your primary window into Linux security.
A typical string looks like this: -rwxr-xr--
We break this down into four distinct parts:
- The File Type (Position 1): A
-means a regular file. Adindicates a directory. - Owner Permissions (Positions 2-4): What the person who owns the file can do.
- Group Permissions (Positions 5-7): What members of the file's assigned group can do.
- Others Permissions (Positions 8-10): What everyone else on the system can do.
Decoding the "rwx" Triad
Each of these groups (Owner, Group, Others) uses the same three-letter code:
| Character | Meaning | Impact on Files | Impact on Directories |
|---|---|---|---|
| r | Read | Can open and view content | Can list files inside |
| w | Write | Can modify or delete content | Can create or delete files inside |
| x | Execute | Can run as a program/script | Can "enter" (cd into) the directory |
If a character is replaced by a hyphen (-), that specific permission is disabled. For example, r-- means read-only.
Concrete Example: Analyzing a Web Config
In our project, we have a configuration file for our web server. Let’s look at its permissions:
Bash-rw-r----- 1 webadmin webgroup 1024 Jan 10 10:00 config.conf
Let's break this down:
-: It is a regular file.rw-(Owner): The userwebadmincan read and edit this file. They cannot execute it, which is correct for a config file.r--(Group): Any user inwebgroupcan read the file, but they cannot change it.---(Others): Everyone else has zero access. This is a secure configuration; we don't want unauthorized users snooping on our server settings.
Hands-on Exercise: Inspecting Your Project
You previously set up your project directories in Project Kickoff: Provisioning Web Server Directories. Let’s check the current state of those folders.
- Navigate to your project root.
- Run
ls -ld logs/to see the directory's permission string. - Identify: Who is the owner? What are the permissions for "Others"?
- Consider this: If "Others" has
r-xon your log directory, what does that imply about security? (Hint: It means anyone on the system can list your log files).
Common Pitfalls
- Confusing
rwithxon Directories: A common mistake is thinking you only needrto access a directory. In Linux, you needx(execute) to "enter" orcdinto a directory. You can haver(read) withoutx, which lets you see the list of files, but not actually access their metadata or content. - Assuming Owner = Root: Just because you are the owner of a file doesn't mean you have
rwx. You can explicitly remove your own write permissions (e.g.,chmod u-w file). However, as the owner, you can always change the permissions back to give yourself access again. - Ignoring the "Others" bucket: Beginners often focus on the owner and group but forget that
othersapplies to every user on the system, including potentially malicious actors or automated service accounts. Always default to---for others unless you have a specific reason to share.
FAQ
Q: Can I change these strings?
A: Yes, we will cover the chmod command in the next lesson to modify these permissions.
Q: What if I see rws or rwt?
A: Those represent special permissions like SUID or the sticky bit, which we discuss in Linux File Permissions: Mastering ACLs and Sticky Bits.
Q: Does changing permissions fix my "Permission Denied" errors? A: Usually, yes. If you get a "Permission Denied" error, it means your current user account doesn't have the required bits (r, w, or x) for the action you are attempting.
Recap
We've moved from simply seeing files to understanding the gatekeepers of the Linux filesystem. By parsing the rwx string, you can audit your server's security and determine exactly who has access to your application's data. Remember: ownership is about identity, while the permission string is about capability.
Up next: We will take these concepts and learn how to actually change permissions using the chmod command.
Work with me

VPS Server Setup, Deployment & Hardening
Get your app live on a fast, secure server — properly configured, hardened, and deployment-ready. No more wrestling with the command line.

Custom Email & File Storage System on Cloudflare (Google Workspace Alternative)
Your own private email + file storage suite on your domain — unlimited mailboxes, no per-seat fees. A self-owned Google Workspace alternative for a flat ~$5/month.


