chmod Permission Calculator

Convert between octal, symbolic and checkbox views of Unix file permissions, including setuid, setgid and the sticky bit.

Converter Converters & Formatters Runs in your browser
Octal (644, 4755) or symbolic (rw-r--r--).
Try:

Result

Octal
644
Symbolic
rw-r--r--
ls -l style
-rw-r--r--
chmod command
chmod 644 file

Breakdown

WhoOctalSymbolicPermissions
Owner (user)6rw-read, write
Group4r--read
Others (world)4r--read
Special bits0-none
Conventions
Common values: 644 for config and data files, 755 for executables and directories, 600 for private keys and files containing secrets, 640 where a service group needs read access.

About chmod Permission Calculator

Unix permissions are three groups of three bits, expressed as an octal digit each. This converts in both directions and flags the combinations that are security problems rather than choices.

umask, and why new files are not 777

Processes create files requesting mode 666 and directories requesting 777; the umask then subtracts permission bits. The common default of 022 removes group and other write, producing 644 files and 755 directories. A umask of 077 produces 600 and 700 — appropriate for a host handling credentials. Because umask only ever removes bits, it cannot grant permissions, which is why a deployment that needs group-writable files must set the mode explicitly rather than relying on it.

Why directories need execute

On a directory, the execute bit means "traverse" - permission to look inside and reach entries by name. A directory with r-- lets you list names but not stat or open anything in it, which produces bafflingly inconsistent errors. Directories need x wherever r is granted, which is why 755 and 750 are the conventional directory modes.

Common use cases

  • Fixing an SSH key rejected for being too permissive (it wants 600).
  • Setting the right mode on a config file containing credentials.
  • Reading an ls -l output back into a chmod command.

Edge cases and gotchas

  • Never make private keys, RADIUS secrets or credential files group- or world-readable.
  • chmod -R on a tree applies file modes to directories too, usually removing the traverse bit and breaking access.

Frequently asked questions

Why does SSH refuse my private key?
OpenSSH rejects keys readable by anyone other than the owner. Set the key to 600 and its parent directory to 700; group-readable keys are treated as compromised.
What does umask 022 mean?
It masks off the write bit for group and others, so new files default to 644 and new directories to 755.