Permissions and owners

The setenforce command

Switches SELinux between Enforcing (1) and Permissive (0) live.

Syntax

sudo setenforce 0|1

Copy-ready examples

$ sudo setenforce 0Set to Permissive
$ getenforceCheck

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • The change does not survive reboot unless you edit /etc/selinux/config.

Related commands

FAQ

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course