Tag: chmod

Linux File Permissions: chmod, chown, umask, and ACLs

Working reference for Linux file permissions. The 9-bit model (user/group/other times rwx), octal shorthand (r=4 w=2 x=1, classic 755 / 644 / 600 / 700 / 777-no-please), reading the ls -l first column for file types (-, d, l, c, b, s, p), chmod numeric vs symbolic syntax, the recursive-chmod foot-gun (use find -type f vs -type d separately, or X capital), chown / chgrp ownership changes, umask defaults (022 vs 027 vs 077), the three special bits (setuid 4 / setgid 2 / sticky 1) with /tmp and /usr/bin/passwd as examples, POSIX ACLs (setfacl -m u:bob:r--) for when 9 bits arent enough. Pitfalls: chmod -R 755 on code trees, SSH 600 / 700 requirements, web-server reading uploads, setuid on scripts (ignored), and what r/w/x actually mean for directories.