Introduction

I’m continuing my 30-Day Linux Challenge as part of my preparation for the RHCSA exam and today’s topic is one of the most important building blocks for working safely and confidently in Linux; Understanding Permissions and how we manage them using the chmod command.

When you work with Linux, permissions decide everything who can read files, who can modify them and who can execute programs.

Whether you’re handling a simple document or a critical system file, knowing how to control access properly with chmod is essential for security, organization and teamwork.

Today, I’ll break it down in a simple, practical way with real-world examples, industry insights and tips you’ll actually use.

Index

  1. What is chmod
  2. Understanding Linux Permission Structure
  3. Practical Examples
  4. Real World Use Cases
  5. Helpful Tips
  6. Industry Insight
  7. Quick Summary

🧠 What is chmod?

chmod stands for change mode. It’s the command we use to change file and directory permissions in Linux.

Permissions define who can do what with a file:

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

✨ Understanding Linux Permission Structure

Each file/directory has three sets of permissions:

Owner Group Others
User who owns the file Users in the group Everyone else

Example:

-rwxr-xr--
  • Owner: read, write, execute (rwx)
  • Group: read, execute (r-x)
  • Others: read only (r--)

⚙️ Basic chmod Usage

Syntax:

chmod [permissions] [file/directory]

📚 Practical Examples

➡️ 1. Giving Execute Permission to a File

chmod +x script.sh

(So you can run the script.)

Image description

Image description

➡️ 2. Removing Write Access from Others

chmod o-w notes.txt

(Others can no longer edit your file.)

Image description

➡️ 3. Setting Specific Permissions (Symbolic Mode)

chmod u=rwx,g=rx,o=r file.txt
  • User: read, write, execute
  • Group: read, execute
  • Others: read

Image description

➡️ 4. Setting Permissions Using Numbers (Octal Mode)

Permission Number
read (r) 4
write (w) 2
execute (x) 1
  • Add the numbers together for each role:
chmod 755 script.sh
  • 7 (Owner): read + write + execute
  • 5 (Group): read + execute
  • 5 (Others): read + execute

Image description

🏭 Real World Use Cases

✅ Making scripts executable (chmod +x deploy.sh)
✅ Locking down sensitive config files (chmod 600 ssh_keys)
✅ Controlling web server permissions (chmod 644 index.html)
✅ Securing private directories (chmod 700 ~/.ssh/)

💡 Helpful Tips

  • Always use minimal permissions needed for safety ("Principle of Least Privilege").
  • Be careful with 777 as it grants full permissions to everyone (not safe for important files).
  • Combine chmod with ls -l to double-check your changes.
  • Practice setting both symbolic (u+x) and numeric (755) permissions — both styles are useful.

🛡️ Industry Insight

In real-world environments:

  • Misconfigured permissions are one of the biggest security risks.
  • DevOps and SysAdmins are expected to master permissions for compliance (ISO, SOC2, etc).
  • Automated deployment tools often use permission scripts so understanding chmod is a critical skill for automation.

✅ Quick Summary

Permissions are the first line of defense in Linux and chmod is the tool you’ll reach for every single day.
Mastering it gives you control, security and professional confidence over any Linux environment.

Image description

I'd love to hear your thoughts, insights or experiences with Linux. Feel free to share and join the conversation [ Connect with me on LinkedIn www.linkedin.com/in/techwithsana ]💜

#30dayslinuxchallenge #redhat #networking #cloudcomputing #cloudenginner #cloudarchitect #cloud #RHCSA #RHCE #RHEL #WomeninTech #Technology