Understanding Linux Permissions: A Beginner-Friendly Guide for DevOps 🚀
Chethan

Chethan @chethanblgs99

About: DevOps Learner | Building Cloud Native Go Web App | Docker | Kubernetes | Terraform | CI/CD

Joined:
Aug 22, 2025

Understanding Linux Permissions: A Beginner-Friendly Guide for DevOps 🚀

Publish Date: Sep 4 '25
0 0

One of the most important concepts that I and many beginners encountered was File Permissions. These topics are super important if you want to become handy with handling Linux files. In this blog, I will deep dive and provide a brief overview of Linux File permissions and help others learn it fast.

📌Listing File Permissions:
To check permissions of a file use: ls -l
Files in Linux have different types:

1) - → regular file
2) d → directory
3) l → symbolic link (e.g., lrwxrwxrwx 1 root root 7 Aug 26 10:00 lib -> usr/lib)

In the permissions string (rwxr-xr-x):
1) r → read
2) w → write
3) x → execute

The string is divided into 3 sets:
1) User (owner)
2) Group
3) Others

So rwxr-xr-x means: owner can read, write, execute; group can read & execute; others can read & execute.

🔑Changing Permissions with chmod:
Permissions can be set numerically or symbolically:

1) Numeric (octal method)
r = 4, w = 2, x = 1
Eg: To give all permissions to all sets of users: chmod 777 file.txt

2) Symbolic (using letters)
Eg:
1) To give read permission to the user: chmod u+r file.txt
2) To give read permissions to both the group and others: chmod go+r file.txt

To remove permission use '-' : chmod g-r file.txt

⚙️Default Permissions with unmask:
When a new file is created, its default permissions depend on the umask value.

Default mask : 022
To change it : umask 021 (This removes read permission from group and execute permission from others)

🔒Special Permission Bits:

Linux also supports advanced permission bits:
1) SUID (Set User ID) – executable runs with file owner’s privileges :

Eg: chmod u+s file.txt , chmod 4555 file.txt

2) SGID (Set Group ID) - Here there are two cases:

  • On files → runs with file group privileges
  • On directories → new files inherit directory’s group

Eg: chmod g+s file.txt , chmod 2777 file.txt

3) Sticky Bit – on directories, prevents deletion of files by anyone except the owner

Eg : chmod +t dir , chmod 1755 file.txt

👥Change Ownership:

1) Change file owner. Eg: chown newuser filename
2) Change group ownership. Eg:chown :newgroup filename
3) Change both. Eg:chown -R newuser:newgroup director

To change group:

1) For a single file. Eg: chgrp newgroup filename
2) For all files in directory. Eg: chgrp -R newgroup directory/

This was my learning summary on Linux permissions. If you’re also exploring DevOps/Linux, practicing these commands hands-on will help things click much faster. Do share it with your newtork and share your thoughts on this 🙌

👉 Which of these file permissions do you use the most ?

Comments 0 total

    Add comment