Linux File Permissions Best Practices for DevOps

Day 10 of #90DaysOfDevOps 🚀 Linux File Permissions: The Concept That Breaks Prod If You Get It Wrong Today I went deeper into permissions — not just syntax, but how access control actually behaves in Linux. What I practiced today: → Created files using `touch`, `echo`, and `vim` → Read content with `cat`, `head`, `tail`, and `vim -R` → Made `script.sh` executable and ran `./script.sh` → Set `devops.txt` to read-only with `chmod -w` → Set `notes.txt` to `640` → Created `project/` with `755` permissions → Triggered `Permission denied` errors intentionally — and understood why Commands That Matter: ✅ `chmod +x` — add execute permission ✅ `chmod 640` — set exact file permissions ✅ `chmod -w` — remove write permission ✅ `vim -R` — open read-only ✅ `ls -l` — always verify changes 💡 Key Insight: `640` is commonly used for sensitive configs like `.env` files, DB configs, or keys. Owner gets read/write, group gets read, others get no access. 🔑 Mindset Shift: `chmod +x` modifies existing permissions. `chmod 755` sets permissions explicitly. In automation, numeric modes are safer and predictable. #90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Linux #DevOps

To view or add a comment, sign in

Explore content categories