Epic: Linux Foundation for DevOps
Work Card: Permission and Ownership
Parent Hub: Building My DevOps Skills in Public
Trello Card: link
Status: ⏳ Active
Introduction
As someone preparing for a DevOps role, I’m learning Linux with a lean approach — focusing only on what’s required to operate and debug real servers.
This post covers Permission and Ownership and hands-on demonstrations on Youtube, from a DevOps perspective.
Objective
This work card focuses on learning how Linux file permissions and ownership work so I can safely operate inside servers, containers, and CI environments without accidentally breaking applications or blocking access.
Why This Matters for DevOps
These skills appear everywhere in DevOps:
- Deploying applications on Linux servers
- Running containers that need file access
- Fixing “permission denied” errors in CI/CD
- Securing config files, SSH keys, and scripts
If permissions are wrong, systems fail silently or dangerously.
Scope
Included:
-
rwxpermissions and numeric modes (755,644) -
chmod,chown,chgrp -
user,group, andothers -
sudobasics
Explicitly excluded (for now):
- ACLs
- SELinux / AppArmor
- Advanced Linux security models
Minimum Required Concepts
| Concept | Purpose |
|---|---|
rwx (read, write, execute) |
Controls who can open, modify, or run files |
user / group / others |
Defines who the permission applies to |
chmod |
Changes file and directory permissions |
chown |
Changes file owner |
chgrp |
Changes file group |
Numeric modes (755, 644) |
Fast way to set permissions in scripts and CI |
sudo |
Run commands as root safely |
Practical Usage (Local Environment)
How this is practiced today:
- Create files and change their permissions
- Block and allow execution of scripts
- Change file ownership between users
- Use
sudoto fix protected files - Reproduce and fix
permission deniederrors
Everything is done on a local Linux machine or VM.
Demo
Orientation — rwx, users, groups, others
In this demo, I demonstrate:
- Ownership (user, group, others) & their Permission (rwx)
- To check permission of current directory using
ls -l. - Understand file-type using
fileand permission on:- owner
- group
- other
Numeric modes
In this demo, I demonstrate:
- Explain numeric values like
-
7meansrwx -
6meansrw- -
5meansr-x -
4meansr-- -
3means-wx -
2means-w- -
1means--x
-
- Show Numeric modes along with permission in human readable-form using
stat
Break & fix access - chmod
In this demo, I demonstrate:
- Create a script file, using
nanoadd input and try to execute it. - Create a directory named
break, removexpermission and see changes.
Ownership — chown
In this demo, I demonstrate:
- Change owner to
rootof script file. - Explain what happend when executing file and why it worked.
Groups — chgrp
In this demo, I demonstrate:
- Change group to
rootof script file. - Explain what happend when executing file and why it NOT worked.
sudo basic
In this demo, I demonstrate:
- read, write, execute operation using
sudo. - Explain what happend.
Operational Confidence (Current State)
After completing these demos, I am confident that I can:
- Interpret permission strings like
-rwxr-xr--to know exactly who can do what - Predict what will happen before running a file based on its mode
- Use
chmodto break and restore execution intentionally - Change ownership with
chownand understand how it affects execution - Use
chgrpto restrict or allow access via group membership - Use
sudoto override permissions when necessary without guessing
DevOps Scenarios Where This Applies (Forward-Looking)
These exact behaviors map directly to real DevOps failures such as:
- CI/CD pipelines failing because build scripts lack
+x - Docker containers crashing because mounted volumes belong to
root - Web servers returning 403 because config files have wrong group ownership
- SSH refusing to use keys because permissions are too open
- Cloud VM setup scripts failing because ownership was changed accidentally
Notes & Observations
Based on what I saw during the demos:
-
Permission deniedalmost always means wrong owner or missingx - A file with
rbut noxcan be read but never executed - Changing owner to
rootcan silently block or allow execution - Group ownership matters only when group permissions allow it
-
sudodoes not change file permissions — it changes who is executing
Status & Next Step
Current status: ⏳ Active
Next work card: Users & Groups
Small, validated progress beats broad, unverified knowledge.
Top comments (0)