Master chown & chmod in Linux – File Permissions Made Simple! | Day 6

If you’ve ever seen a “Permission denied” error in Linux, you’re not alone. Understanding Linux file permissions is one of the most fundamental skills every DevOps, SysAdmin, and cybersecurity learner must master.

In this post (Day 6 of our Linux Learning Series), you’ll finally understand chmod, chown, and Linux permissions — with clear examples, simple analogies, and real-world use cases.

Prefer to watch? Here’s the full video tutorial:

Linux permissions control who can read, write, or execute a file or folder.

Each file has three sets of permissions:

  • 👤 Owner
  • 👥 Group
  • 🌐 Others

You’ll see something like this:

Let’s break that down:

  • r = read
  • w = write
  • x = execute
  • - = no permission

🔧 What is chmod?

chmod stands for change mode. It’s used to change file permissions.

🔹 Syntax:





chmod [permissions] [filename]

🛠 Example: Give execute permission to a script

chmod +x deploy.sh

🧠 Numeric Mode Explained

NumberPermission
7read, write, execute (rwx)
6read, write (rw-)
5read, execute (r-x)
4read only (r–)

Example:

chmod 755 app.sh

This means:

  • Owner: rwx
  • Group: r-x
  • Others: r-x

What is chown?

chown means change owner. It lets you assign a new owner and group to a file or directory.

🔹 Syntax:

chown [owner]:[group] [filename]

🛠 Example: Transfer ownership to user ubuntu

chown root:ubuntu app.sh

🧪 Common Real-World Use Cases

✅ Give execute access to a shell script
✅ Fix permissions for web server (Apache/Nginx)
✅ Secure logs so only root can read them
✅ Hand off file ownership between users

🧠 Pro Tips for DevOps & Security Engineers

  • Use ls -l to list permissions
  • Use chmod -R and chown -R for recursive changes
  • Be very cautious with chmod 777 – it makes files world-accessible

📘 Cheat Sheet

CommandDescription
chmod +xAdd execute permission
chmod 644Read/write for owner, read for others
chown userChange file owner
chown user:groupChange owner and group

📌 Conclusion

Understanding chown and chmod isn’t just about memorizing commands. It’s about knowing how Linux protects your system. Whether you’re scripting, deploying, or locking down your servers — file permissions matter.

📚 Stay tuned for Day 7, where we dive into process management and signals in Linux!

💬 Questions or Suggestions?

Drop a comment below or message me on LinkedIn. Let’s master Linux together!

Leave a Reply

Your email address will not be published. Required fields are marked *