How the numbers work
Each digit is one class of user (owner, group, others) and is the sum of read (4), write (2) and execute (1). 7 is all three; 5 is read and execute; 4 is read only. So 755 means the owner can do everything and everyone else can read and execute.
A fourth leading digit sets special bits: setuid (4), setgid (2) and sticky (1). 1777 is the usual mode for /tmp, where anyone can create files but only delete their own.
| Mode | Typical use |
|---|---|
| 644 | Ordinary files: web pages, config |
| 600 | Private files: SSH keys, .env, credentials |
| 755 | Directories and scripts |
| 700 | Private directories, such as ~/.ssh |
| 640 | Config readable by a service's group |
| 775 | Shared project directories |
| 1777 | /tmp and shared upload areas |