ZapKit

chmod calculator

Decode or build Unix and Linux file permissions: type 644, 4755 or rwxr-xr-x and see exactly who can do what.

What is a chmod calculator?

A chmod calculator translates Unix file permissions between the numeric form used with the chmod command and the letter form shown by ls -l. Developers, server administrators and students use it to set up web servers, deploy scripts, fix permission-denied errors and secure keys.

Enter a three- or four-digit octal mode or nine permission letters. You get the octal and symbolic forms, the chmod command, any special bits, a table of read, write and execute for owner, group and others, and a plain sentence describing who can do what.

How to use the chmod calculator

  1. 1.Enter a mode

    Octal like 755 or 0644, or the letters from ls -l.

  2. 2.Read the table

    Read, write and execute for owner, group and others.

  3. 3.Copy the command

    chmod with the right number, ready to run.

Example: a setuid program

ls -l shows -rwsr-xr-x for a system program:

Octal
4755
Owner / group / others
read, write, execute / read, execute / read, execute
Special bits
setuid

Anyone can run it, and it runs with its owner's permissions.

How the digits work

Each digit covers one audience: owner, group, then everyone else. Read is worth 4, write 2 and execute 1, added together, so 7 means all three, 5 read and execute, 6 read and write, and 4 read only. 755 is typical for programs and folders; 644 for ordinary files; 600 for private keys.

An optional fourth digit at the front sets special bits: 4 for setuid, 2 for setgid and 1 for the sticky bit, which stops users deleting each other's files in shared folders such as /tmp (mode 1777). In the letter form they appear as s or t in the execute positions.

Frequently asked questions

What does execute mean on a folder?

Permission to enter it and reach files inside. Without it, read only lists names.

Is 777 safe?

Rarely. It lets every user change or replace the file, so use the narrowest mode that works.

What is a capital S or T?

The special bit is set but execute isn't, which is usually a mistake.

Does this change any files?

No. It only works out the numbers.

More Developer tools

Network & system