Temporarily and Permanently Disabling SELinux

  1. Temporarily disable

Run the command setenforce 0 to temporarily disable SELinux

  1. Permanently disable

a. Open the selinux config file

vi /etc/selinux/config

b. Find SELINUX=enforcing, press i to enter edit mode, and change the parameter to SELINUX=disabled.

c. When you are done, press the Esc key, type the command :wq, and the file is saved and closed.

  1. Run the command getenforce and verify that SELinux is disabled, which means SELinux is turned off.

Author: Tang Moying

Source: /en/post/disable-selinux

License: this article is shared under "CC BY 4.0". Please credit the author and link back to the original when republishing.