Who may do what
Linux is multi-user: every file has an owner, a group, and permissions for three audiences — the owner (u), the group (g) and everyone else (o). That's why you can't read /etc/shadow, and why a leaked web server can't delete your home folder.
Reading and changing permissions
id ls -l /etc/passwd /etc/shadow cat /etc/shadow sudo cat /etc/shadow touch deploy.sh secret.txt ls -l deploy.sh chmod u+x deploy.sh chmod 600 secret.txt ls -l deploy.sh secret.txt mkdir shared sudo chown asha:developers shared sudo chmod 775 shared ls -ld shared
- 644 — files: owner writes, everyone reads
- 755 — scripts and directories
- 600 — private keys and secrets
- 777 — almost never: everyone can change it