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.

ModeSymbolicTypical use
chmod 777rwxrwxrwxAlmost never correct. Sometimes used temporarily while debugging a permissions problem.
chmod 775rwxrwxr-xShared project directories where a group of users all need to write.
chmod 755rwxr-xr-xThe standard for directories, scripts and executables you want others to run but not edit.
chmod 750rwxr-x---Directories and programs only the owner and one trusted group should use.
chmod 700rwx------Private directories such as ~/.ssh, and scripts only the owner should run.
chmod 666rw-rw-rw-Rarely used. World-writable files, sometimes seen for shared sockets or device nodes.
chmod 664rw-rw-r--Shared files that a group collaborates on.
chmod 644rw-r--r--The standard for regular files: web pages, config files and documents.
chmod 640rw-r-----Config files containing credentials that a service group needs to read.
chmod 600rw-------Private keys (~/.ssh/id_ed25519), .env files and other secrets.
chmod 444r--r--r--Files that should be read-only for everyone, including the owner.
chmod 400r--------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--.

Copied to clipboard