chmod calculator
Common permissions
| Number | Letters | Use it for |
|---|---|---|
| 644 | rw-r--r-- | Normal files: web pages, config files |
| 755 | rwxr-xr-x | Folders and programs or scripts others may run |
| 600 | rw------- | Secrets: .env files, SSH private keys |
| 700 | rwx------ | Private folders, such as ~/.ssh |
| 640 | rw-r----- | Files a service's group needs to read |
Avoid 777: it lets every user on the system change the file. If something "only works with 777", the owner is wrong; fix it with chown instead.
More free tools: systemd service generator, SSH key generator, all tools. Guide: secure your server.