How do you disable SELinux in Linux?

Subh Singh
Invent the Future

In Linux, the setenforce command is used to change the SELinux mode. It means the user can use this command to change SELinux from Enforcing mode to Permissive mode. In Permissive mode, SELinux does not enforce security rules, but it records policy violations.

Command:

sudo setenforce 0

Example:

If you want to change the SELinux mode to Permissive in Linux, you can use the following command.

sudo setenforce 0

Output:

[user@localhost ~]$

Here:

  • setenforce 0 changes SELinux to Permissive mode.
  • Permissive mode allows actions but records policy violations.

How to use:

  • Open the Linux terminal.
  • Type the command.
  • Press Enter to run the command.