Moorfleeter Deich 216, 22113 Hamburg +49 1774661716 info@bastcom.de Mo. - Fr.: 09:00 - 18:00
Designer
ITWeb Knowledge

Howto Disable SELinux

Introduction

Security-Enhanced Linux (SELinux) is a security module in Linux that enforces access control policies. It can sometimes interfere with applications, such as Joomla, by restricting necessary permissions. This guide explains how to check whether SELinux is running, disable it temporarily or permanently, and configure it to log warnings instead of enforcing strict policies.

1. Checking if SELinux is Running

To determine if SELinux is currently enabled, use one of the following commands:

selinuxenabled && echo "enabled" || echo "disabled"

or

sestatus

2. Temporarily Disabling SELinux

To temporarily disable SELinux and check if it's causing an issue, execute the following command as root:

echo 0 > /selinux/enforce

To re-enable SELinux without rebooting, run:

echo 1 > /selinux/enforce

This command modifies the /selinux/enforce file, setting SELinux enforcement mode to either 1 (enabled) or 0 (disabled).

3. Configuring SELinux to Log Warnings Instead of Blocking

If you want SELinux to log warnings rather than enforcing restrictions, enable permissive mode. To do this, edit the SELinux configuration file at /etc/selinux/config and change:

SELINUX=permissive

Changes will take effect after a system reboot.

4. Permanently Disabling SELinux

To completely disable SELinux, edit /etc/selinux/config and set:

SELINUX=disabled

A reboot is required for this change to take effect. Alternatively, you can disable SELinux temporarily using the method described above.

By following these steps, you can diagnose SELinux-related issues, configure it to allow necessary permissions, or disable it if needed.