Moorfleeter Deich 216, 22113 Hamburg
+49 1774661716info@bastcom.deMon–Fri: 09:00–18:00

Blog

ITWeb Knowledge

Tech news, AI and practical knowledge – around WordPress, Joomla, hosting and web development.

Howto Disable SELinux

← Back to the blog

Introduction

Security-Enhanced Linux (SELinux) is a security module in Linux that forces access control policies. It can sometimes interfere with applications, such as Joomla, by restricting necessary permissions. This guide explains how to check when 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. Temporary 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 ether 1 (enable) or 0 (disabled)

3. Configuration 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 wants take effect after a system reboot.

4. Permanent 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 missions, or disable it if needed.