Chmod Calculator: Linux Permissions 755, 644, rwxr-xr-x
Convert Linux file permissions between numbers (755) and symbols (rwxr-xr-x), with the chmod command and umask.
- ls -l view (file)
- -rwxr-xr-x
- Command
- chmod 755 script.sh
- Symbolic command
- chmod u=rwx,g=rx,o=rx script.sh
- Owner
- read, write, execute
- Group
- read, execute
- Others
- read, execute
- New files with umask 022
- 644 (-rw-r--r--)
- New folders with umask 022
- 755 (drwxr-xr-x)
Formula and sources
Each class (owner, group, others) is one digit: read = 4, write = 2, execute = 1, added up; rwx = 7, r-x = 5, r-- = 4 A fourth, leading digit holds the special bits: setuid = 4, setgid = 2, sticky = 1 (4755, 2775, 1777) Umask: new files get 666 minus the umask bits, new folders 777 minus them; umask 022 → 644 and 755
When to use the Chmod Calculator
Three digits, three classes
A number such as 755 is read digit by digit: owner, group, then everyone else. Each digit adds read (4), write (2) and execute (1), so 755 is the same as rwxr-xr-x. Tick the boxes, type the number or type the symbols: all three always change together.
The modes you meet most
644 for ordinary files such as HTML and config files, 755 for scripts you run and for folders, 600 for SSH private keys and 700 for the ~/.ssh folder. The quick picks fill these in.
Setuid, setgid and sticky
A fourth, leading digit holds the special bits. Setuid (4) runs a program with its owner's rights, setgid (2) makes new files in a folder take the folder's group, and sticky (1) on a folder such as /tmp lets users delete only their own files.
Umask sets the defaults
New files start at 666 and folders at 777, then the umask's bits are removed. A umask of 022 gives 644 files and 755 folders; 077 gives the more private 600 and 700.
Frequently asked questions
Why does SSH ignore my private key?
OpenSSH ignores a private key that other users can access. Run chmod 600 on the key file and chmod 700 on the ~/.ssh folder, then try again.
How do I change a folder and everything in it?
chmod -R gives everything the same mode, yet folders need execute and plain files do not. It is safer to use find: 755 for folders and 644 for files, each with its own command.
What is the difference between chmod and chown?
chmod changes the read, write and execute permissions. chown changes who owns the file and its group. The two are often used together when setting up a web app's folders.
Related calculators
- Linux Swap SizeSwap size from RAM, with or without hibernation, by the Red Hat Enterprise Linux and Fedora recommendation table.Example: Recommended swap4 GBCalculate →
- VM Host SizingVirtualisation hosts needed for a list of VMs by vCPU and RAM, with overcommit, reserve and N+1.Example: Hosts needed3Calculate →
- Password EntropyEntropy in bits of a random password or passphrase, time to guess and NIST SP 800-63B's minimum length.Example: Entropy71.5 bitCalculate →