Chmod calculator
Convert Unix file permissions between check boxes, octal (755) and symbolic (rwxr-xr-x) form, with setuid, setgid and sticky bits and warnings for risky modes.
Owner
Group
Others
Special
chmod 644 FILE
chmod u=rw,g=r,o=r FILE
Nothing risky stands out in this mode: it is not world-writable and has no setuid or setgid bit.
Everything you type here stays in your browser. Nothing is sent to HardenKit or to anyone else.
How to use the chmod calculator
- Tick the permissions for owner, group and others, or type a mode in octal or symbolic form.
- The three views stay in sync: change one and the others follow.
- Add setuid, setgid or sticky under Special if you need them.
- Read the findings, then copy the chmod command.
About this tool
Every file on a Unix system has nine permission bits: read, write and execute, for the owner, for the group and for everyone else. Octal notation writes each set of three as one digit, with read worth 4, write 2 and execute 1. So 7 is rwx, 5 is r-x, and 755 means the owner can do everything while group and others can read and execute.
Three more bits sit in front. Setuid makes a program run as its owner, setgid as its group, and the sticky bit on a directory lets only a file’s owner delete it. They form a fourth digit: 4755, 2755, 1777. In a listing they replace the x with s or t, in capitals when the execute bit underneath is off.
Two choices deserve a second look. A world-writable file or directory, any mode whose last digit has the 2, can be changed by every account and every compromised service on the machine. A setuid program owned by root is a standing way to root if it has a flaw. The fix for a permission error is almost never chmod 777.
Sources
Questions
The owner can read, write and execute. The group and everyone else can read and execute but not write. It is the usual mode for directories and for programs, shown as rwxr-xr-x.
644 lets the owner read and write and lets everyone else read. 600 gives the owner read and write and nobody else anything. Private keys, credentials and .env files should be 600: SSH refuses a private key that others can read.
It lets every user and every process on the system modify the file, or add and remove files in the directory. A web server compromised through one application can then alter another’s code. Find the user that needs access and grant it through ownership or a group.
It is the setuid bit together with execute. The program runs with the privileges of the file’s owner, not of the user who starts it. A capital S means setuid is set but execute is not, which is usually a mistake.