Skip to content
TrySitePrice

CentOS / RHEL: Disable or Enable SELinux Policy Modules

Best/Tutorial

In CentOS or Red Hat Enterprise Linux (RHEL), you can disable or enable SELinux policy modules using the setsebool command.

Here's how to disable a SELinux policy module:

  1. Determine the name of the SELinux policy module you want to disable. You can use the following command to list all the available SELinux policy modules:

    semodule -l

  2. Use the following command to disable the SELinux policy module:

    setsebool -P <module_name> off

    Replace <module_name> with the actual name of the SELinux policy module you want to disable.

rnHere's how to enable a SELinux policy module:
  1. Determine the name of the SELinux policy module you want to enable. You can use the following command to list all the available SELinux policy modules:

    semodule -l

  2. Use the following command to enable the SELinux policy module:

    setsebool -P <module_name> on

    Replace <module_name> with the actual name of the SELinux policy module you want to enable.

rnNote: Disabling or enabling SELinux policy modules can affect the security of your system. Be sure to understand the consequences of disabling or enabling a particular policy module before you do so.