setenforce

Change SELinux mode between enforcing and permissive.

What it does

setenforce switches SELinux between enforcing (policy enforced) and permissive (violations logged but not blocked).

Quick Start

# Set enforcing
sudo setenforce 1

# Set permissive
sudo setenforce 0

Examples

# Check current mode
getenforce

# Temporarily disable enforcement
sudo setenforce 0

# Re-enable enforcement
sudo setenforce 1

Notes