Disabling SELinux on CentOS, RHEL

Software

I had reason to disable SELinux on a VM. On CentOS and RHEL you can do temporarily with:

$ sudo setenforce 0

To set permanently, change this flag in the following file:

$ sed 's/SELINIX=enforcing/SELINUX=disabled/' \
    /etc/selinux/config

Filing here because I always forget.

Author bio and support

Me!

Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.