How do Linux file permissions work, and what do `chmod` and `chown` change?
Answer
Linux permissions are evaluated for file owner, group and others, with read, write and execute bits. `chmod` changes permission bits, while `chown` changes ownership. Numeric modes such as 644 and 755 are compact representations: 644 is typically read/write for owner and read-only for others; 755 additionally gives execute permission to group and others.
Strong answer includes
- owner, group and others are separate permission classes
- chmod changes mode while chown changes ownership
- can explain common numeric modes without recommending 777
Practical example
If a deployed script exists but returns `Permission denied`, inspect `ls -l` first. A correct fix may be `chmod u+x run-tests.sh`; blindly using `chmod -R 777` changes far more permissions than the problem requires.