How to close selinux?
Close selinux
1. Get the status of selinux through the command “getenforce”,
Recommended: “Linux Tutorial》
[root@localhost ~]# getenforce Enforcing //enforcing means open, [root@localhost ~]# getenforce Permissive // permissive means warning [root@localhost ~]# getenforce Disabled //disabled means off [root@localhost ~]#
2. You can close selinux by entering commands in the terminal. This method is only temporarily closed and has no effect after restarting
[root@localhost ~]# setenforce 0 //close [root@localhost ~]# getenforce Permissive [root@localhost ~]# setenforce 1 //Open [root@localhost ~]# getenforce Enforcing
3. Modify the selinux state through the configuration file “/etc/sysconfig/selinux”, this method needs to restart the machine
[root@localhost ~]# gedit /etc/sysconfig/selinux # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled
4. Close selinux by modifying “/boot/grub/menu.lst”, so that selinux will not be started every time you boot
[root@localhost ~]# gedit /boot/grub/menu.lst default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hidden menu title CentOS (2.6.32-431.el6.i686) root (hd0,0) kernel /vmlinuz-2.6.32-431.el6.i686 ro root=/dev/mapper/VolGroup-lv_root nomodeset rd_NO_LUKS rd_NO_MD rd_LVM_LV=VolGroup/lv_swap crashkernel=auto vga=ask.UTF-8 rd_LVM_LV=VolGroup/lv_root KEYBO ARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet selinux=0 initrd /initramfs-2.6.32-431.el6.i686.img
The above is the detailed content of how to close selinux, please pay attention to other related articles on 1024programmer.com for more information!