Symbolic vs numeric permissions
Unix permissions are three groups of three bits: owner, group, others. Each group has read (r=4), write (w=2) and execute (x=1). The numeric mode is just each group's three bits summed: rwx→7, r-x→5, r--→4. So 754 means owner can read/write/execute, group can read/execute, and everyone else can only read.
Special bits
- setuid (4): runs with the file owner's privileges — often
4755. - setgid (2): directories inherit the group; files run with the group's privileges.
- sticky bit (1): only the owner can delete files, even in a shared dir like
/tmp(hence1777).
Common modes
644— owner write, everyone read (typical files).755— owner full, group/others read+execute (scripts, dirs).600— owner only, private (SSH keys).777— everyone everything — usually a security smell; prefer something tighter.