How to use the chmod Calculator
- Tick the permissions you want for Owner, Group and Others.
- Or type the octal number (like
644) or the symbolic form (likerw-r--r--). - Add setuid, setgid or the sticky bit if you need them.
- Copy the
chmodcommand.
How the numbers work
Each digit is the sum of read (4), write (2) and execute (1), for the owner, the group and everyone else in that order. So 7 = 4 + 2 + 1 = read, write and execute, 5 = 4 + 1 = read and execute, and 4 = read only.
| Number | Symbolic | Typical use |
|---|---|---|
644 | rw-r--r-- | Normal files: web pages, images, config |
755 | rwxr-xr-x | Folders and scripts that everyone may run |
600 | rw------- | Private files, such as SSH keys and .env files |
700 | rwx------ | Private folders and scripts |
775 | rwxrwxr-x | Shared folders for a team group |
777 | rwxrwxrwx | Anyone can change it. Avoid on servers |
Special bits
A fourth digit in front adds special modes: 4 setuid (run as the file's owner), 2 setgid (run as the group, or new files in a folder inherit its group) and 1 sticky (only owners can delete their files in a shared folder, as on /tmp, which is 1777).
Frequently asked questions
What does chmod 755 mean?
The owner can read, write and run it; the group and everyone else can read and run it, but not change it.
What's the difference between 644 and 755?
755 adds execute permission for everyone. Folders need execute to be opened, so use 755 for folders and 644 for ordinary files.
Is chmod 777 dangerous?
On a server, yes. Any user or compromised process can change or replace the file. Use the lowest permissions that work.
How do I apply it to a folder and everything inside?
Add -R: chmod -R 755 folder. Careful: this also makes every file executable. Many people run find to give folders 755 and files 644 separately.
Updated