SELinux context
The label user:role:type:level that SELinux attaches to every file and process, of which the type is what the policy checks.
In more detail
A new file takes the type of its directory, while a moved file keeps its old label. The policy's file contexts map paths to types; restorecon applies that map, and semanage fcontext -a adds a local rule to it. chcon changes a label directly, but a relabel puts the mapped type back.
Examples
semanage fcontext -a -t httpd_sys_content_t '/web(/.*)?'restorecon -Rv /webRelated terms
- SELinux — A Linux security layer that labels every process, file and port and allows only the accesses its policy lists.
- SELinux mode — Whether SELinux refuses and logs disallowed accesses (enforcing), only logs them (permissive), or is off (disabled).
Taught in
- Exam Strategy: Order, Verify, And The Docs You May Use — Red Hat Certified System Administrator (EX200) Exam Prep
- Diagnosing Permission Problems — Red Hat Certified System Administrator (EX200) Exam Prep
- Recovering Root And Changing The Boot Loader — Red Hat Certified System Administrator (EX200) Exam Prep
- SELinux Contexts: Labels, restorecon And Rules That Last — Red Hat Certified System Administrator (EX200) Exam Prep
- SELinux Ports And Booleans: The Other Two Refusals — Red Hat Certified System Administrator (EX200) Exam Prep
- Drill: The Machine That Will Not Boot — Red Hat Certified System Administrator (EX200) Exam Prep
- Drill: Storage, Then SELinux, Then The Firewall — Red Hat Certified System Administrator (EX200) Exam Prep
- Mock Exam, Part 1: Eighteen Tasks, One Reboot — Red Hat Certified System Administrator (EX200) Exam Prep
- Forbidden, With Perfect Permissions: Paths, ACL Masks And SELinux Denials — CompTIA Linux+ (XK0-006) Exam Prep
- Ninety Minutes, Five Domains: The Full Mock And The Week Before The Exam — CompTIA Linux+ (XK0-006) Exam Prep
- RHEL System Roles: timesync And selinux From A Collection — RHCE in Ansible (EX294): Automate Red Hat Systems
- SELinux: Labels, Ports And Booleans That Persist — RHCE in Ansible (EX294): Automate Red Hat Systems