quick-docs/modules/ROOT/partialsdelete/2delete-proc_disabling-selinux.adoc

71 lines
2.1 KiB
Text
Raw Normal View History

2018-06-22 16:10:52 +00:00
// Module included in the following assemblies:
//
// changing-selinux-states-and-modes.adoc
[#{context}-disabling-selinux]
2018-06-22 16:10:52 +00:00
= Disabling SELinux
Use the following procedure to permanently disable SELinux.
2018-06-22 16:10:52 +00:00
[IMPORTANT]
====
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.
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
====
[Warning]
====
Disabling SELinux using the SELINUX=disabled option in the /etc/selinux/config results in a process in which the kernel boots with SELinux enabled and switches to disabled mode later in the boot process. Because memory leaks and race conditions causing kernel panics can occur, prefer disabling SELinux by adding the selinux=0 parameter to the kernel command line as described in Changing SELinux modes at boot time if your scenario really requires to completely disable SELinux.
====
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
. Open the `/etc/selinux/config` file in a text editor of your choice, for example:
2020-11-09 15:56:49 +00:00
+
[subs="quotes"]
2018-06-22 16:10:52 +00:00
----
# vi /etc/selinux/config
----
2018-06-22 16:10:52 +00:00
. Configure the SELINUX=disabled option:
+
[subs="quotes"]
----
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
----
. Save the change, and restart your system:
----
# reboot
2018-06-22 16:10:52 +00:00
----
.Verification
2020-11-09 15:56:49 +00:00
* 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
----