The scenario
You are deploying a website, configuring a server, or fixing a permissions error. A tutorial says to use chmod 755, but your terminal shows -rwxr-xr-x. You need to know whether those two notations mean the same thing.
A chmod converter helps translate between the numeric octal form and the symbolic form used by commands such as ls -la.
How chmod permissions work
Unix and Linux permissions are split into three groups: owner, group, and others. Each group can receive read, write, and execute access.
read = 4 = r
write = 2 = w
execute = 1 = x
Add the values for each group. A digit of 7 means read + write + execute. A digit of 5 means read + execute. A digit of 4 means read only.
Octal to symbolic conversion
0 = ---
1 = --x
2 = -w-
3 = -wx
4 = r--
5 = r-x
6 = rw-
7 = rwx
Three digits cover owner, group, and others. So 755 becomes owner rwx, group r-x, and others r-x. Written as a file mode, that is -rwxr-xr-x.
Use the Chmod Calculator to toggle permissions or type an octal value and see the symbolic form immediately.
Common chmod values
chmod 755
755 is common for directories and executable scripts. The owner can read, write, and execute. Group and others can read and execute but cannot write.
chmod 755 public
# -rwxr-xr-x
chmod 644
644 is common for regular website files such as HTML, CSS, JavaScript, images, and public text files. The owner can edit, while group and others can read.
chmod 644 index.html
# -rw-r--r--
chmod 600
600 is for private files such as SSH keys, local secrets, and environment files. Only the owner can read and write.
chmod 600 ~/.ssh/id_rsa
# -rw-------
chmod 700
700 is common for private directories. Only the owner can enter, list, or modify the directory.
chmod 700 ~/.ssh
# -rwx------
Recursive chmod pitfall
Be careful with chmod -R. Running chmod -R 755 applies execute permission to every file inside the directory, including regular files that do not need it.
For a website directory, set directories and files separately:
find /var/www/html -type d -exec chmod 755 {} \;
find /var/www/html -type f -exec chmod 644 {} \;
Why chmod 777 is risky
777 gives owner, group, and others full read, write, and execute access. On a shared or internet-facing system, that means any user or compromised process may be able to modify the file. Use the narrowest permissions that still let the application work.
FAQ
How do I convert chmod octal to symbolic notation?
Convert each octal digit into read, write, and execute bits. 4 means read, 2 means write, and 1 means execute. Add the bits for owner, group, and others. For example, 755 becomes rwxr-xr-x.
What is the difference between chmod 755 and 644?
755 gives the owner full access and gives group and others read and execute access. 644 gives the owner read and write access while group and others get read-only access.
Why should I avoid chmod 777?
777 gives everyone read, write, and execute access. On shared or internet-facing systems, that allows any user or process to modify or execute the file, so it should be avoided unless there is a very specific reason.