Every file on a Linux system carries a three-digit permission code, and 755 is the one you will see most. Those digits are not magic — they are a compact way of saying who can read, write, and run a file. Here is how to read them at a glance.
Three digits, three audiences
A chmod number like 755 is three digits, and each digit answers one question: what can this group of people do with this file? The digits are always in the same order:
- First digit — owner: the user who owns the file, usually the person who created it.
- Second digit — group: the group the file belongs to, such as the developers group or the web server group.
- Third digit — others: everyone else on the system.
So 755 means the owner gets one set of permissions, the group gets a second, and everyone else gets a third. When you see a file listed as -rwxr-xr-x, that is the same information in symbolic form: the first three letters after the dash are the owner's permissions, the next three are the group's, and the last three are everyone else's.
What each digit means: read, write, execute
Each digit is a number from 0 to 7, and it is the sum of three values: read is 4, write is 2, and execute is 1. Add them up for the permissions you want:
- 7 = 4 + 2 + 1: read, write, and execute — full control.
- 6 = 4 + 2: read and write, but not execute.
- 5 = 4 + 1: read and execute, but not write.
- 4 = read only.
- 2 = write only. Rare, and usually a mistake.
- 1 = execute only. Also rare.
- 0 = no permissions at all.
Now 755 decodes itself: 7 for the owner (read, write, execute), 5 for the group (read and execute), and 5 for everyone else (read and execute). The owner can change the file; everyone else can read it and run it, but cannot modify it. That is the standard for scripts and directories on a web server, and it is why you see it everywhere.
Reading the rwx string
The symbolic form is the same idea written out letter by letter. A file shown as -rw-r--r-- is 644: the owner can read and write (rw-), the group can read (r--), and everyone else can read (r--). A directory shown as drwxr-xr-x is 755, and the leading d just marks it as a directory rather than a file.
For directories, "execute" means something different from files: it means permission to enter the directory and access the files inside it. A directory with read but no execute lets people list file names but not open anything. A directory with execute but no read lets people open files they already know the name of, but not browse the contents. This is why directories almost always carry the execute bit and files often do not.
The common numbers and when to use them
- 755 — directories and scripts: the owner has full control, everyone else can read and execute. The safe default for folders and programs.
- 644 — regular files: the owner can read and write, everyone else can read. The safe default for documents, images, and web pages.
- 600 — private files: only the owner can read and write. Use it for SSH keys, password files, and anything sensitive.
- 700 — private directories: only the owner can enter. Use it for your
.sshfolder and other private directories. - 400 — read-only files: the owner can read, nobody can write — not even the owner, without changing the permissions first.
Most files on a healthy system are 644 and most directories are 755. If you find yourself reaching for anything more permissive, stop and ask why. There is almost always a narrower fix, like changing the file's group instead of opening it to the world.
Changing permissions: the chmod command
Changing permissions takes one command. To set a file to 644, run chmod 644 filename. To set a script to 755 so it can run, use chmod 755 script.sh. The -R flag applies the change to a directory and everything inside it: chmod -R 755 myfolder. Be careful with -R — it changes every file in the tree, and undoing a bad recursive change is tedious.
You can also change permissions symbolically, which is handy for small tweaks: chmod u+x script.sh adds execute permission for the owner only, and chmod go-w file.txt removes write permission from the group and others. Symbolic mode is precise; numeric mode is faster when you know the exact number you want.
The permissions to never use
The most dangerous number in chmod is 777: read, write, and execute for everyone. It is the go-to fix in a thousand forum answers, and it is almost always the wrong one. A file at 777 can be modified by any user or process on the system, which means a compromised web application can rewrite it, and a careless script can delete it. If a web server cannot read a file, the fix is to check the owner and group, not to open the file to the world.
The same warning applies to 666 (everyone can read and write) and to running chmod -R 777 on a directory, which opens every file inside it. These numbers also break tools that check permissions for safety: SSH refuses to use a private key that is readable by others, and Git warns loudly about overly open files. When something does not work, the answer is to find which user needs which access and grant exactly that — nothing more.
Worked example: fixing a web page
Say your web server returns a 403 error on a page. Check the permissions with ls -l. If the file is 600, the server — running as a different user — cannot read it at all. Change it to 644 with chmod 644 page.html, and the server can read it while nobody else can modify it. If the whole folder is 700, the server cannot even enter it: set the directory to 755 with chmod 755 foldername.
If the page is a script that needs to run, it needs the execute bit: 755 for a script the server executes, 644 for a page it only reads. Work from the least privilege that makes the thing work, and you will never need 777.
Frequently asked questions
What does 755 mean in chmod?
It means the owner can read, write, and execute (7), while the group and everyone else can read and execute but not write (5 and 5). It is the standard permission for directories and executable scripts. In symbolic form it is written rwxr-xr-x.
What is the difference between 644 and 755?
644 is for regular files: the owner can read and write, everyone else can read only. 755 adds the execute bit for everyone, which files need only if they are programs or scripts. Directories almost always use 755, because the execute bit on a directory means permission to enter it and access the files inside.
Why is chmod 777 dangerous?
777 gives every user and process on the system full read, write, and execute access to the file. Any compromised application or careless script can modify or delete it, and security tools like SSH will refuse to use keys with such open permissions. If a file is unreadable, fix the owner or group instead of opening it to everyone.
How do I change permissions on many files at once?
Use the -R flag for recursive changes, such as chmod -R 755 myfolder, which sets the whole directory tree. Use it carefully, because it changes every file inside, including ones that should stay private. A safer pattern is to set directories and files separately: find myfolder -type d -exec chmod 755 {} + and find myfolder -type f -exec chmod 644 {} +.