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