Enable & Disable SELinux

Enable & Disable SELinux on CentOS :

Disable SELinux :
Run on terminal
# echo 0 > /selinux/enforce
# setenforce 0
No need to reboot using above commands but when system will reboot SELinux will be enabled again.

Enable SELinux :
# echo 1 > /selinux/enforce
# setenforce 1
No need to reboot using above commands.

Permanent Solution (Disable SELinux ):
Open file /etc/selinux/config
change SELINUX=enforcing to SELINUX=permissive 
SELINUX=enforcing to SELINUX=disabled
Reboot the system.
It will disable the SELinux permanently.

Check status of SELinux
# getenforce
Output is :

Another command :
# sestatus
Output is :
SELinux status:                 disabled

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...