惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
D
DataBreaches.Net
C
Check Point Blog
雷峰网
雷峰网
小众软件
小众软件
GbyAI
GbyAI
美团技术团队
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学
MyScale Blog
MyScale Blog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
Jina AI
Jina AI
爱范儿
爱范儿
Last Week in AI
Last Week in AI
MongoDB | Blog
MongoDB | Blog
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Linux File Permissions Explained Simply
Sreekanth Kuruba · 2026-05-26 · via DEV Community

Sreekanth Kuruba

Ever ran a Linux command and saw this?

Permission denied

It feels random at first — but it’s not.

That error is Linux protecting your system using file permissions.

Once you understand this, Linux security suddenly starts making sense.


What Are Linux File Permissions?

Every file and directory has three types of permissions:

  • Read (r) → View file content
  • Write (w) → Modify or delete file
  • Execute (x) → Run file as a program/script

👉 These decide what you are allowed to do with a file.


3 Types of Users in Linux

Permissions are not just for files — they are for users.

User Type Symbol Meaning
Owner u The owner of the file
Group g Users in the same group
Others o Everyone else

👉 Linux is a multi-user system, so access control is essential.


Understanding ls -l (Very Important)

Run this command:

ls -l

Example output:

-rwxr-xr-- 1 user group  1024 Apr 10 12:34 script.sh

Now it Breakdown:

  • First character → - = file, d = directory
  • Next 3 → Owner permissions
  • Next 3 → Group permissions
  • Last 3 → Others permissions

Permission Symbols

Symbol Meaning
r Read
w Write
x Execute
- No permission

Changing Permissions chmod

Make script executable

chmod +x script.sh

Numeric method (very common in servers)

chmod 755 script.sh

Numeric permissions are a shortcut to set all three permission types at once.


Common Numeric Permissions:

Number Permission Meaning
7 rwx Read + Write + Execute
6 rw- Read + Write
5 r-x Read + Execute
4 r-- Read only

👉 So:

755 = rwx r-x r-x

Owner → full access
Group → read + execute
Others → read + execute


Change Owner (chown)

chown username file.txt
chown user:group file.txt  

Recursive:

chown -R user:group folder/

Only the root user or sudo user can change ownership.

Changing Group (chgrp)

chgrp developers project/

Used when:

multiple developers work on same project
shared access is needed


⚠️ Dangerous Mistake Beginners Make

chmod 777 file.txt     # ❌ Very Dangerous

🚨 This gives:

full access to everyone
no security control
breaks Linux permission model

👉 Never use this in real servers.


Real-Life Example

You create a script:

./script.sh

And get:

Permission denied

Fix:

chmod +x script.sh
./script.sh

👉 This is one of the most common Linux beginner issues.


Simple Mental Model

Think of Linux permissions like a building:

Owner → has master key
Group → shared access card
Others → guest access

And:

r → can look inside
w → can modify
x → can enter/run

Summary

You learned:

  • What r, w, x mean
  • User types (owner, group, others)
  • How to read ls -l
  • Using chmod
  • Numeric permissions (755, 644, etc.)
  • Changing ownership with chown
  • Changing groups with chgrp
  • Why chmod 777 is dangerous

Why This Matters

File permissions are not just theory.

They are used in:

Linux servers
DevOps pipelines
Docker containers
Cloud systems
Production deployments

👉 If you understand this, you understand Linux security basics.


Next Post:

Linux User & Group Management Explained Simply,useradd, usermod, groups


Which permission concept confused you the most when you first used Linux?

I’ll simplify it even further in Part 4.