Convert between octal and symbolic Linux permissions, and see exactly what each bit allows.
| Owner | Group | Others | |
|---|---|---|---|
| Read | |||
| Write | |||
| Execute |
Owner can read, write, and execute it. Group can read and execute it. Others can read and execute it.
Owner can list its contents, create, rename, and delete entries, and enter it (traverse). Group can list its contents and enter it (traverse). Others can list its contents and enter it (traverse).
find . -perm 755 # exactly this modefind . -perm -755 # all of these bits are setfind . -perm /755 # any of these bits are setA umask removes bits from the maximum a new file can receive — 666 for files, 777 for directories. It never grants a bit, so a umask cannot make a file executable.
Apply this mode with chmod 755 path for a file or directory, or chmod -R 755 path to recurse.
Symbolic modifiers such as u+x or g-w are not supported here: they change a mode relative to an existing one, so they need a starting mode to apply against. Build the result you want in the grid, then use the octal value.
Every file and directory on a Unix system carries a mode: twelve bits that describe who may do what with it. Nine of those bits form a three-by-three grid — three classes of user (the owner, the group, and others) crossed with three permissions (read, write, and execute). The remaining three are the special bits: setuid, setgid and sticky.
The familiar octal notation is just those nine bits grouped in threes, with each digit the sum of read (4), write (2) and execute (1) for one class. That is why the digits only ever run from 0 to 7 — and why chmod 8 is not a permission error but a syntax error.
Permissions are checked in order, and the first class that matches wins. If you are the file’s owner, the group and others bits are never consulted — even if they would grant more access. A file owned by you with mode 000 is unreadable by you even though others can read it.
These are the modes you will meet in practice. The octal value is what you pass to chmod.
| Mode | Symbolic | Owner | Group | Others |
|---|---|---|---|---|
| 644 | -rw-r--r-- | read, write | read | read |
| 600 | -rw------- | read, write | none | none |
| 755 | -rwxr-xr-x | read, write, execute | read, execute | read, execute |
| 700 | -rwx------ | read, write, execute | none | none |
| 2775 | -rwxrwsr-x | read, write, execute | read, write, execute (setgid) | read, execute |
| 1777 | -rwxrwxrwt | read, write, execute | read, write, execute | read, write, execute (sticky) |
| 4755 | -rwsr-xr-x | setuid | read, execute | read, execute |
The ten-character string that ls -l prints is a type character followed by the same nine bits: three for the owner, three for the group, three for everyone else. The leading character is - for a regular file, d for a directory, l for a symlink, and b, c, p or s for the special file types.
The detail most calculators get wrong: when a special bit lands on an execute position, the letter is lowercase only if the execute bit is also set. -rwsr-xr-x is setuid with execute and works. -rwSr--r-- is setuid without execute — the capital S is a warning sign, because the setuid bit is set on a file that cannot be run, so it accomplishes nothing. The same rule produces t versus T for the sticky bit.
This calculator reports both forms, so you can see immediately whether a setuid or sticky bit you have just set is doing anything.
Permissions drift. Files get created with an over-permissive umask, setuid binaries survive long after the vendor that shipped them has gone, and a world-writable directory turns up somewhere nobody expected. The three searches worth putting in a recurring audit are setuid and setgid files, world-writable files, and world-writable directories without the sticky bit — the last of which is the dangerous combination, since every user can delete every other user’s files.
Windows equivalents: if you are auditing NTFS ACLs rather than POSIX modes, the same reasoning applies with a different model — Allow and Deny entries, inheritance from parent folders, and the rule that an explicit Deny always wins. The NTFS Permissions Calculator works out the effective permissions when several sources combine.
DMC IT Services provides Linux server hardening, permission and privilege audits, and infrastructure support for SMBs across London, Cambridge, Hertfordshire, and Bedfordshire.
Talk to an Engineer