chmod Made Simple: How to Control File Permissions in Linux
13:48, 20.11.2026
When we work with Linux, we constantly interact with files. We read them, change them, run them. And very quickly we encounter the issue of access control. This is where the chmod command comes in. We will explain it in a simple, interesting way, without unnecessary theory. You will understand what is happening and start managing files with confidence.
Why do we need chmod?
Linux was created as a multi-user system. Different people can work on the same server at the same time. We don't want anyone to accidentally delete our files or run a dangerous script.
The chmod command helps us determine who can do what with a file or directory. We set the rules of the game ourselves. You gain control, and the system becomes more secure.
Three types of access you should know about
In Linux, every file has three basic permissions:
- read allows you to read the file
- write allows you to modify the file
- execute allows you to run the file as a program
We encounter them all the time, even if we don't notice it. For example, a script without execute permission simply won't run. You can open it in an editor, but you can't execute it.
Who exactly gets these rights
Now let's talk about users. Linux divides everyone into three groups:
- owner file owner
- group user group
- others everyone else
When we change permissions using chmod, we always work with these three categories. You can allow only yourself to run the file or open access to the entire system.
Symbolic mode chmod read as text
Let's start with the most intuitive method. We use letters.
Example:
chmod u+x script.sh
We speak to Linux in simple terms. We add execute rights for the file owner. The letter u stands for owner. The symbol +adds rights. The letter x is responsible for execution.
You can combine:
chmod ug+rw file.txt
We allow reading and writing to the owner and group. You can see the logic right away. That's why this mode is convenient for learning.
Numeric mode
Now let's move on to the mode that administrators love. It looks mysterious, but we'll quickly reveal the secret.
Each right has a number:
| read | 4 |
| write | 2 |
| execute | 1 |
We simply add the numbers together.
Example:
chmod 755 app.sh
We give:
- owner 7, i.e., read, write, execute
- group 5, i.e., read, execute
- others 5, i.e., read, execute
You will often see 644 for text files and 755 for programs. This is standard practice in Linux systems.
Directories and chmod
There is a nuance here. We cannot ignore directories. Rights work a little differently for them.
- read allows you to view the list of files
- write allows you to create and delete files
- execute allows you to enter the directory
If you don't execute, you won't be able to enter the folder even if you can see its contents. This often surprises newbies.
Recursive permission changes
We can apply chmod to the entire folder structure:
chmod -R 755 project/
You change the permissions for all files and directories inside. This gives you a powerful tool. But we always recommend checking the path. One mistake can change the permissions of half the system.
Common mistakes to avoid
We don't give 777 without a reason. Full access for everyone creates security risks. You open the door wider than necessary.
You should not run scripts from the internet without checking the permissions. Execute means trust. You should always understand what you are running.
Conclusion
So manage your system consciously. chmod only seems complicated at first glance. That's why we broke it down into simple parts. You now understand how Linux reads access permissions and how we can change them.
When you manage file permissions, you manage the security and stability of the system. We recommend practicing. Open a terminal, create a test file, and play around with chmod. That's how knowledge becomes a skill.