Enable & Disable SELinux

Enable & Disable SELinux on CentOS :

Disable SELinux :
Run on terminal
# echo 0 > /selinux/enforce
or
# 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
or
# setenforce 1
No need to reboot using above commands.

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

Check status of SELinux
# getenforce
Output is :
Disabled

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

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...