Chmod calculator

What is a Chmod Calculator?

On Linux and other Unix-like systems, every file has three sets of permissions: for the owner, the group and everyone else (others). Each set can allow read, write and execute. The chmod command changes them, using either octal numbers like 755 or symbolic notation like u=rwx,g=rx,o=rx. This calculator converts between the two and builds the command for you.

How to use it

  1. Tick read, write and execute for owner, group and others.
  2. Read the octal value and symbolic string.
  3. Copy the ready-made chmod command.

How the octal value is built

Read = 4, write = 2, execute = 1. Add the values for each set. Owner rwx = 4+2+1 = 7, group r-x = 4+1 = 5, others r-x = 5, giving 755, shown by ls -l as rwxr-xr-x.

Common permission sets

  • 644 (rw-r--r--): normal files such as HTML, config and documents.
  • 755 (rwxr-xr-x): directories and executable scripts.
  • 600 (rw-------): private files such as SSH private keys and .env files.
  • 700 (rwx------): private directories such as ~/.ssh.
  • 777: everyone can do everything. Avoid it; it is a common security hole.

Execute on directories

For a directory, execute means permission to enter it and access files inside, and read means permission to list its contents. A directory with 644 cannot be entered, which is why directories normally need 755.

Special bits

A fourth leading digit sets setuid (4), setgid (2) and the sticky bit (1), for example 1777 on /tmp.

Frequently Asked Questions

What does chmod 755 mean?

The owner can read, write and execute, while the group and others can read and execute. It is standard for directories and scripts.

What permissions should an SSH private key have?

600, so only the owner can read and write it. SSH refuses to use keys with looser permissions.

Why is chmod 777 dangerous?

It lets every user on the system modify or replace the file, which can be abused to inject code.

How do I apply permissions recursively?

Use chmod -R, but be careful: files and directories usually need different modes, so find with -type f or -type d is safer.