How to use it
- Tick the read, write and execute boxes for the owner, the group and everyone else.
- Or type an octal value such as 640, or a symbolic string such as rw-r----- or -rw-r----- copied from ls -l.
- Add setuid, setgid or the sticky bit if needed, or pick a common value.
- Enter the file name and copy the chmod command.
How it works
Each of the three classes (owner, group, others) has three permissions. Read is worth 4, write 2 and execute 1, and their sum is one octal digit, so rwx = 7, r-x = 5 and r-- = 4. Three digits make the mode: 755 means rwx for the owner and r-x for the group and others.
An optional fourth digit in front holds the special bits: 4 for setuid, 2 for setgid and 1 for sticky. In symbolic form they replace the execute position: s for setuid or setgid, t for sticky. A capital S or T means the special bit is set but execute is not, which is usually a mistake.
The symbolic box accepts nine characters (rwxr-xr-x) or the ten-character form that ls -l prints, where the first character is the file type (- for a file, d for a directory) and is ignored here. A trailing . or + from SELinux or ACLs is also accepted.
Two commands are shown: the octal form, which sets all bits at once, and the equivalent symbolic form such as u=rwx,g=rx,o=rx. File names with spaces or other special characters are quoted for the shell; a leading ~/ and the wildcards * and ? are left unquoted so the shell can expand them. With GNU chmod, an octal mode on a directory does not clear setuid or setgid bits that are already set; use the symbolic form, or a five-digit mode such as 00755, if you need to remove them.
Examples
Web files and folders
Files that the web server only reads are usually 644 (rw-r--r--), and directories 755 (rwxr-xr-x) so they can be entered and listed.
Private SSH key
SSH refuses keys that others can read. Tick only read and write for the owner to get 600 and the command chmod 600 ~/.ssh/id_ed25519 (enter the path as the file name).
Shared upload directory
/tmp-style directories use 1777 (rwxrwxrwt): everyone can create files, but the sticky bit stops users deleting each other's files.
Frequently asked questions
What is the difference between 755 and 775?
With 775 the group can also write (create, change and delete files in a directory). With 755 only the owner can write; the group and others can read and execute.
Why should I avoid 777?
777 lets every user on the system change or replace the file. On a web server that can let another account or a compromised process inject code. Give write access only to the owner or a specific group.
What does execute mean for a directory?
For a directory, execute (x) means permission to enter it and reach files inside. Read alone lets you list names but not open the files.
Does this change permissions on my computer?
No. It only calculates values and builds the command text. You run the command yourself in a terminal.
Privacy
Everything is calculated in your browser. The file name you type is not sent anywhere, stored or included in analytics.