Temporarily disable SELinux in Fedora.

I know, I know, most Fedora users probably are giving me the evil eye as they read this, but I find this tip useful when something on my desktop machine isn’t behaving properly and I want to see if it’s SELinux causing the behaviour, or if I want to stop the security for I one time only test.

For example, when migrating some of our unit tests, some virus scanning unit tests were failing, as this was a test I don’t run on my Desktop except on this occasion, it was simply easier to disable SELinux while I run the test.. it ran fine, so I could turn it back on, and tick it off my list.

By disable I actually mean put SELinux into passive mode, which allows everything, but still logs problems.

Anyway, to temporarily disable SELinux as root run one of these:
echo 0 > /selinux/enforce
setenforce 0

To re-enable it simply echo 1:
echo 1 > /selinux/enforce
setenforce 1

2 comments ↓

#1 Li Jie on 01.04.10 at 10:10 pm

Hmm, do a lot of Fedora users use SELinux? Or just Fedora users at the NAA?

#2 matt on 01.05.10 at 10:50 am

Well SELinux is turned on my default on a Fedora 12 install.

Leave a Comment