chmod numbers explained

What 755 and 644 actually mean, so you stop copying them blindly.

SNP 115 #26B Filed cmd linux

Three digits: owner, group, everyone else. Each digit adds up read (4), write (2) and execute (1).

Digit Means
7 read, write, execute
6 read, write
5 read, execute
4 read only
0 nothing

So 755 is "I can do everything, everyone else can read and run it": the usual for directories and scripts. 644 is the same without execute: the usual for files. 600 is for things like private keys that nobody else should even read.

shell
chmod 755 deploy.sh
chmod 644 index.html
chmod 600 ~/.ssh/id_ed25519

Directories need execute to be entered, which is why chmod -R 644 on a folder locks you out of it. Use chmod -R u+rwX,go+rX instead; the capital X only adds execute to directories and to files that already have it.