Modes you will actually type
Common permission modes | Octal | Symbolic | Typical use |
| 644 | -rw-r--r-- | Regular files: config, HTML, images |
| 755 | -rwxr-xr-x | Scripts, binaries, directories |
| 600 | -rw------- | Secrets: SSH keys, .env files |
| 700 | -rwx------ | Private directories |
| 400 | -r-------- | Read-only key material |
| 664 | -rw-rw-r-- | Group-writable shared files |
| 2775 | drwxrwsr-x | Shared dir, group inherited (setgid) |
| 1777 | drwxrwxrwt | World-writable temp dir (/tmp) |
| 777 | -rwxrwxrwx | Almost never correct |
What each bit does
Permission bits | Value | Bit | On a file | On a directory |
| 4 | read | Read contents | List entries |
| 2 | write | Modify contents | Create / delete entries |
| 1 | execute | Run as a program | Enter / traverse |
| 4000 | setuid | Runs as the file owner | No effect on Linux |
| 2000 | setgid | Runs as the file group | New entries inherit the group |
| 1000 | sticky | No effect on Linux | Only the owner may delete an entry |
Reading the symbolic string
Symbolic notation | Character | Position | Meaning |
d | Type | Directory (- file, l symlink) |
s | Owner / group execute | setuid or setgid, execute also set |
S | Owner / group execute | setuid or setgid, execute not set |
t | Other execute | Sticky bit, execute also set |
T | Other execute | Sticky bit, execute not set |
Common umask values
umask defaults | umask | New files | New directories |
| 022 | 644 | 755 |
| 002 | 664 | 775 |
| 027 | 640 | 750 |
| 077 | 600 | 700 |
Need to work out a specific mode? Open the calculator · unsure what a mode means? Read the FAQ.