Chmod permissions cheat sheet
Quick reference for the Linux file permission modes you will actually use. Click a mode for the full explanation, or use the chmod calculator to build your own.
| Mode | Symbolic | Typical use |
|---|---|---|
| chmod 777 | rwxrwxrwx | Almost never correct. Sometimes used temporarily while debugging a permissions problem. |
| chmod 775 | rwxrwxr-x | Shared project directories where a group of users all need to write. |
| chmod 755 | rwxr-xr-x | The standard for directories, scripts and executables you want others to run but not edit. |
| chmod 750 | rwxr-x--- | Directories and programs only the owner and one trusted group should use. |
| chmod 700 | rwx------ | Private directories such as ~/.ssh, and scripts only the owner should run. |
| chmod 666 | rw-rw-rw- | Rarely used. World-writable files, sometimes seen for shared sockets or device nodes. |
| chmod 664 | rw-rw-r-- | Shared files that a group collaborates on. |
| chmod 644 | rw-r--r-- | The standard for regular files: web pages, config files and documents. |
| chmod 640 | rw-r----- | Config files containing credentials that a service group needs to read. |
| chmod 600 | rw------- | Private keys (~/.ssh/id_ed25519), .env files and other secrets. |
| chmod 444 | r--r--r-- | Files that should be read-only for everyone, including the owner. |
| chmod 400 | r-------- | Highly sensitive read-only files such as certificate private keys. |
How the digits work
Each digit is the sum of read (4), write (2) and execute (1) for owner, group and others in that order. So 7 = 4+2+1 = rwx, 5 = 4+1 = r-x, 4 = r--.