🐧 Linux / Shell Scripting
Beginner
How do you change file permissions?
Answer
Use chmod (change mode). In octal mode: chmod 755 file sets owner=rwx, group=r-x, others=r-x. In symbolic mode: chmod u+x file adds execute for owner; chmod g-w file removes write for group; chmod o=r file sets others to read-only; chmod a+x file adds execute for all. chmod -R 644 /dir applies recursively. Common patterns: 600 for private keys (owner read/write only), 644 for web files, 755 for directories and executables, 777 is insecure and should be avoided.