2018-06-22 16:10:52 +00:00
// Module included in the following assemblies:
//
// changing-selinux-states-and-modes.adoc
2020-10-29 14:55:18 +00:00
[#{context}-disabling-selinux]
2018-06-22 16:10:52 +00:00
= Disabling SELinux
2020-11-09 20:24:44 +00:00
When SELinux is disabled, SELinux policy is not loaded at all; it is not enforced and AVC messages are not logged. Therefore, all benefits of running SELinux listed in xref:{context}-benefits-of-selinux[Benefits of SELinux] are lost.
2018-06-22 16:10:52 +00:00
[IMPORTANT]
====
2020-11-09 15:56:49 +00:00
It is recommended to use permissive mode instead of permanently disabling SELinux. See xref:{context}-changing-to-permissive-mode[] for more information about permissive mode.
2018-06-22 16:10:52 +00:00
====
2020-11-09 15:56:49 +00:00
.Prerequisites
2018-06-22 16:10:52 +00:00
2020-11-09 15:56:49 +00:00
* The [package]`grubby` package is installed:
+
[subs="quotes"]
----
$ *rpm -q grubby*
grubby-_version_
----
.Procedure
To permanently disable SELinux:
. Configure your bootloader to add `selinux=0` to the kernel command line:
+
2020-10-29 20:14:11 +00:00
[subs="quotes"]
2018-06-22 16:10:52 +00:00
----
2020-11-09 15:56:49 +00:00
$ *sudo grubby --update-kernel ALL --args selinux=0*
2020-10-29 14:55:18 +00:00
----
2018-06-22 16:10:52 +00:00
2020-11-09 15:56:49 +00:00
. Restart your system:
2020-10-29 14:55:18 +00:00
+
[subs="quotes"]
----
2020-11-09 15:56:49 +00:00
$ *reboot*
2018-06-22 16:10:52 +00:00
----
2020-11-09 15:56:49 +00:00
.Verification step
* After reboot, confirm that the [command]`getenforce` command returns `Disabled`:
2018-06-22 16:10:52 +00:00
+
2020-11-09 15:56:49 +00:00
[subs="quotes"]
2018-06-22 16:10:52 +00:00
----
2020-11-09 15:56:49 +00:00
$ *getenforce*
2018-06-22 16:10:52 +00:00
Disabled
----