CentOS / RHEL: Disable or Enable SELinux Policy Modules

CentOS / RHEL: Disable or Enable SELinux Policy Modules

To disable or enable SELinux policy modules on a CentOS or Red Hat Enterprise Linux (RHEL) system, you can use the semodule command.

  1. Determine the name of the SELinux policy module that you want to disable or enable. You can use the semodule -l command to list all the installed SELinux policy modules:
semodule -l
Source:‮ttual.www‬uri.com

The output will list the names of the installed SELinux policy modules, along with their status.

  1. Use the semodule command with the -d option to disable an SELinux policy module:
semodule -d MODULE_NAME

Replace MODULE_NAME with the name of the SELinux policy module that you want to disable.

For example, to disable the httpd_selinux module, you would run:

semodule -d httpd_selinux
  1. Use the semodule command with the -e option to enable an SELinux policy module:
semodule -e MODULE_NAME

Replace MODULE_NAME with the name of the SELinux policy module that you want to enable.

For example, to enable the httpd_selinux module, you would run:

semodule -e httpd_selinux

Disabling or enabling SELinux policy modules can affect the security and functionality of your system. Consult the documentation for the policy module and your applications to ensure that they will still function properly after the module has been disabled or enabled.

Created Time:2017-10-27 14:56:36  Author:lautturi