chmod permissions calculator
Convert Linux/Unix file permissions between checkboxes, octal notation (755) and symbolic notation (rwxr-xr-x), including setuid, setgid and the sticky bit, and copy the ready-to-use chmod command.
How Linux permissions work
Every file or folder on a Linux, macOS or Unix system has three sets of permissions: for the owner (u), the group (g) and other users (o). Each set can have read (r), write (w) and execute (x) permission. On a folder, "execute" means being able to enter it.
In octal notation each permission has a value: r = 4, w = 2 and x = 1, and they add up. So 7 (4+2+1) is rwx, 6 (4+2) is rw- and 5 (4+1) is r-x. That is why chmod 755 is the same as rwxr-xr-x.
Most common permissions
644 (rw-r--r--): regular files, such as web pages or configuration; only the owner can change them. 755 (rwxr-xr-x): folders and executable scripts. 600 (rw-------): private files, such as SSH keys. 700 (rwx------): private folders. Avoid 777: it lets any user modify the file and is a security risk on a web server.
setuid, setgid and the sticky bit
The fourth digit (the first one when there are four) enables special permissions: setuid (4) makes an executable run with its owner's permissions, like passwd; setgid (2) on a folder makes new files inherit its group; and the sticky bit (1) on a folder stops users from deleting other users' files, as in /tmp (1777). In symbolic notation they show up as s, s and t instead of x.