chmod Calculator
Tick the permissions you want and get the octal number, the rwx form and a ready-to-use chmod command — or type a number like 755 to see what it means.
| Read (4) | Write (2) | Execute (1) | Special | |
|---|---|---|---|---|
| Owner (user) | ||||
| Group | ||||
| Others (world) |
Common permissions
How chmod numbers work
Each of the three groups — owner, group and others — gets one digit made by adding: read = 4, write = 2, execute = 1. So 7 = 4+2+1 (read, write and execute), 5 = 4+1 (read and execute), 6 = 4+2 (read and write), 4 = read only. chmod 755 file gives the owner full access and everyone else read and execute; 644 is the usual permission for ordinary files and 600 keeps a file private to its owner.
A fourth leading digit sets special bits: setuid (4) and setgid (2) run a program with its owner's or group's rights, and the sticky bit (1) on a directory stops users deleting each other's files (as in /tmp). In the symbolic form these show as s or t in place of x, and as capital S or T when execute is not set.
Avoid 777 (anyone can change the file) on a web server. For a website, folders are normally 755 and files 644.