chmod Made Simple: How to Control File Permissions in Linux

watch 3m, 8s
views 2

13:48, 20.11.2026

Article Content
arrow

  • Why do we need chmod?
  • Three types of access you should know about
  • Who exactly gets these rights
  • Symbolic mode chmod read as text
  • Numeric mode
  • Directories and chmod
  • Recursive permission changes
  • Common mistakes to avoid
  • Conclusion

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.

Share

Was this article helpful to you?

VPS popular offers

-10%

CPU
CPU
8 Epyc Cores
RAM
RAM
32 GB
Space
Space
200 GB NVMe
Bandwidth
Bandwidth
Unlimited
KVM-NVMe 32768 Linux

€ 70.49 /mo

€
/mo

Billed annually

-10%

CPU
CPU
3 Epyc Cores
RAM
RAM
2 GB
Space
Space
20 GB NVMe
Bandwidth
Bandwidth
Unlimited
aiKVM-NVMe 2048 Linux

€ 9.51 /mo

€
/mo

Billed annually

-10%

CPU
CPU
6 Epyc Cores
RAM
RAM
8 GB
Space
Space
100 GB NVMe
Bandwidth
Bandwidth
Unlimited
aiKVM-NVMe 8192 Linux

€ 28.47 /mo

€
/mo

Billed annually

-10%

CPU
CPU
4 Epyc Cores
RAM
RAM
4 GB
Space
Space
50 GB NVMe
Bandwidth
Bandwidth
Unlimited
aiKVM-NVMe 4096 Linux

€ 17.77 /mo

€
/mo

Billed annually

-10%

CPU
CPU
6 Xeon Cores
RAM
RAM
16 GB
Space
Space
150 GB SSD
Bandwidth
Bandwidth
Unlimited
KVM-SSD 16384 Linux

€ 49.99 /mo

€
/mo

Billed annually

-10%

CPU
CPU
6 Xeon Cores
RAM
RAM
8 GB
Space
Space
100 GB SSD
Bandwidth
Bandwidth
Unlimited
MT5 KVM 8192 Windows

€ 29.99 /mo

€
/mo

Billed annually

-4.4%

CPU
CPU
4 Xeon Cores
RAM
RAM
4 GB
Space
Space
100 GB HDD
Bandwidth
Bandwidth
300 Gb
wKVM-HDD HK 4096 Windows

€ 17.99 /mo

€
/mo

Billed annually

-10%

CPU
CPU
6 Xeon Cores
RAM
RAM
8 GB
Space
Space
200 GB HDD
Bandwidth
Bandwidth
300 Gb
KVM-HDD HK 8192 Linux

€ 21.79 /mo

€
/mo

Billed annually

-8.9%

CPU
CPU
6 Xeon Cores
RAM
RAM
16 GB
Space
Space
400 GB HDD
Bandwidth
Bandwidth
Unlimited
wKVM-HDD 16384 Windows

€ 56 /mo

€
/mo

Billed annually

-10%

CPU
CPU
10 Xeon Cores
RAM
RAM
64 GB
Space
Space
300 GB SSD
Bandwidth
Bandwidth
Unlimited
KVM-SSD 65536 Linux

€ 134.99 /mo

€
/mo

Billed annually

Other articles on this topic

cookie

Accept cookies & privacy policy?

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the HostZealot website.