0
0
Linux-cliConceptBeginner · 3 min read

What is 755 Permission in Linux: Explained Simply

In Linux, 755 permission means the owner can read, write, and execute, while others can only read and execute. It is commonly used to allow everyone to run a file or access a directory but only the owner can modify it.
⚙️

How It Works

Linux permissions control who can read, write, or run files and folders. The number 755 is a shortcut to set these permissions using three digits. Each digit represents permissions for the owner, the group, and others.

Think of it like a house with three types of visitors: the owner, family members (group), and guests (others). The owner has full access (read, write, execute), family and guests can enter and look around (read and execute) but cannot change anything (no write).

The digits come from adding numbers for each permission: read = 4, write = 2, execute = 1. So, 7 means 4+2+1 (full access), and 5 means 4+0+1 (read and execute).

💻

Example

This example shows how to set 755 permission on a script file named run.sh. It means the owner can edit and run it, others can only run it.

bash
chmod 755 run.sh
ls -l run.sh
Output
-rwxr-xr-x 1 user user 0 Apr 27 12:00 run.sh
🎯

When to Use

Use 755 when you want to let others run or access your files or directories but not change them. For example, scripts or programs that many users need to execute but should not modify.

It is common for web server files or shared scripts where the owner manages the content, but everyone else can use it safely.

Key Points

  • 7 means full access (read, write, execute) for the owner.
  • 5 means read and execute for group and others.
  • 755 is safe for shared executable files.
  • It prevents others from modifying your files.

Key Takeaways

755 permission lets the owner read, write, and execute a file or directory.
Group and others can read and execute but cannot modify the file or directory.
It is commonly used for scripts and programs that need to be run by many users.
The digits 7 and 5 come from adding read (4), write (2), and execute (1) values.
Use 755 to safely share executable files without allowing changes by others.