SELinux
Cheat sheet · https://pcornel.dk/topic.php?topic=2849
Answer
SELinux is mandatory access control on RHEL-family systems: every process and file has a security context, and the policy decides which domains may access which types, regardless of Unix permissions.
Remember
Never disable SELinux to fix a problem: read the AVC denial and fix the label (restorecon, semanage fcontext), boolean (setsebool -P) or port (semanage port). Use permissive mode only briefly to confirm.
First checks
sealert -a /var/log/audit/audit.log— explained denials (setroubleshoot)sestatus / aa-status— SELinux or AppArmor statess -tulpn— listening servicesjournalctl -u sshd -g 'Failed'— failed loginsausearch -m avc,user_login -ts today— audit events (auditd)
Verify in this order
process domain and file type → policy rule checked → allowed or AVC denial logged
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=2849