Intro
Intro
SELinux mode and file labels (Fedora/RHEL-family) plus Linux file capabilities. On Ubuntu, AppArmor is more common — still useful to recognize SELinux tools on mixed fleets.
Commands in this part
| Command | Role |
|---|---|
getenforce |
getenforce prints the current SELinux mode: Enforcing, Permissive, or Disabled. |
setenforce |
setenforce switches SELinux between Enforcing (1) and Permissive (0) until reboot (or until changed again). |
restorecon |
restorecon restores the default SELinux file contexts for paths based on policy file-context rules. |
| getcap / setcap | Linux file capabilities grant subsets of root privilege to executables (e.g. |
Suggested starting points
- Mode:
getenforce/setenforce(temporary permissive for triage only). - Labels after copy/mv:
restorecon. - Selective privilege on binaries:
getcap/setcap.