Chmod Calculator
Convert Unix file permissions between checkboxes, octal and rwx text and copy the chmod command
| Read | Write | Execute | |
|---|---|---|---|
| Owner | |||
| Group | |||
| Others |
chmod 644 file.txtAbout Chmod Calculator
Converts Unix file permissions between the checkbox view, the octal number (like 755) and the symbolic text (like rwxr-xr-x), and writes the chmod command for you.
Tick the permissions for owner, group and others, or type an octal number or symbolic text in the boxes: they stay in sync. Copy the finished chmod command.
Folders need the execute bit to be entered, so a folder is usually 755 or 700 while a plain file is 644 or 600. Private keys such as SSH keys should be 600, and many programs refuse to use them otherwise.
- What do the numbers in 755 mean?
- Each digit is the sum of read (4), write (2) and execute (1). The three digits are owner, group and others, so 755 is owner read-write-execute and group and others read-execute (rwxr-xr-x).
- What is the difference between 644 and 755?
- 644 gives the owner read and write and everyone else read only, which suits normal files. 755 adds execute for everyone, which suits programs and folders.
- What are setuid, setgid and sticky?
- Special bits shown as a leading fourth digit. Setuid (4) and setgid (2) make a program run as its owner or group. Sticky (1) on a shared folder lets only a file's owner delete it, as on /tmp (1777).
- Why does the symbolic text show s, S, t or T?
- A lower-case s or t means the special bit is set and execute is also set. An upper-case S or T means the special bit is set but execute is not, which is usually a mistake worth checking.
- Does this change files on my computer?
- No. It only calculates the value and writes the command for you to run yourself in a terminal.
How to use Chmod Calculator
Tick read, write and execute for owner, group and others, or type an octal number (such as 755) or symbolic text (such as rwxr-xr-x). All three views stay in sync. Quick buttons set common values, the special-bit boxes add setuid, setgid and sticky, and the command line at the bottom can be copied with a file name and the recursive option.
When to use it
Use it when you need the right number for chmod, want to read what a permission string such as drwxr-x--- allows, or are setting up web server files, scripts and SSH keys and want to be sure a file is not open to everyone.
When not to use it
It builds the numeric or text mode and the command; it does not change any file. It also does not cover access control lists, file ownership (chown) or the umask that sets default permissions for new files.
Tips for best results
Typical values: 644 for ordinary files, 755 for programs and folders, 600 for private keys and 700 for private folders. Avoid 777 on a server because it lets any user change the file. With -R, a mode that suits folders (needs execute) often gives files execute permission they should not have.
Limitations
Only the nine standard permission bits and the three special bits are covered. The symbolic box needs exactly nine characters (leave out the leading file-type letter). Symbolic forms such as u+x or a=r are not parsed. The recursive option adds -R, which applies the same mode to files and folders alike.
Privacy
The calculation is done in your browser from your clicks. Nothing is uploaded and no file on your computer is touched.
More from Security & Developer: