How to Disable SElinux


#1

Transfered from Linux Config Disqus comments:

Question:

Hi Lubos, is there a way to disable SElinux on my linux system?

Answer:

SElinux ( Security Enhanced Linux )may cause some problems during various software installations. Here are some quick tips on how to disable SElinux temporarily or permanently. I do not recommend to disable SElinux completely! However, disabling SElinux just temporarily may help in troubleshooting to narrow down all possible problems and to see whether the problems your are experiencing are related to SElinux.

Temporarily disable SElinux

It is easy to disable SElinux from command line by setenforce command:

# setenforce 0

This will disable SElinux temorarlily until your system will reboot or you enable SElinux with:

# setenforce 1

The commands above are same as disabling SElinux with:


# echo 0 > /selinux/enforce


Permanently disable SElinux

To permanently disable SElinux you need to edit SElinux’s config file /etc/selinux/config and add/alter line disable it:

SELINUX=disabled

#2