Pcornel
Linux · Security

File Permissions

Cheat sheet · https://pcornel.dk/topic.php?topic=2847

Back to the Topic

Answer

File permissions are the base access control on Linux: owner/group/other mode bits, special bits (SUID/SGID/sticky) and default umask.

Remember

Check sensitive files: /etc/shadow (0640 or 0000), private keys (600), sudoers (440). Find world-writable files and unexpected SUID binaries regularly.

First checks

  • sestatus / aa-status — SELinux or AppArmor state
  • ss -tulpn — listening services
  • journalctl -u sshd -g 'Failed' — failed logins
  • ausearch -m avc,user_login -ts today — audit events (auditd)

Verify in this order

mode bits and ownership → kernel checks on every access → audit finds deviations

Where it usually breaks

First mismatch in identity/group resolution → Unix mode/ACL/capability → mount/sandbox constraint → SELinux/AppArmor policy → credential/TLS trust → protected operation; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2847

Confirmation

Confirm action

Continue?