If you donโt fully understand permissions, youโll:
- break apps
- expose your server
- get random โPermission deniedโ errors
Letโs fix that.
๐ Understanding Permissions
Example:
-rwxr-xr-- 1 user user file.sh
Breakdown:
r= readw= writex= execute
Groups:
- owner
- group
- others
๐ข Numeric Permissions
| Number | Meaning |
| 7 | rwx |
| 6 | rw- |
| 5 | r-x |
| 4 | r– |
Example:
chmod 755 file.sh
๐ค Change Ownership
chown user:group file
Example:
chown www-data:www-data /var/www/html
โ ๏ธ Common Mistakes
โ Using:
chmod 777
๐ This gives full access to everyone โ security risk
๐ฅ Best Practices
- Web apps:
755 for folders
644 for files
- SSH:
chmod 600 ~/.ssh/id_rsa
๐ง Summary
Permissions are critical for both security and stability โ master them early.