關(guān)閉selinux
目前成都創(chuàng)新互聯(lián)公司已為1000+的企業(yè)提供了網(wǎng)站建設(shè)、域名、網(wǎng)站空間、網(wǎng)站托管、服務(wù)器托管、企業(yè)網(wǎng)站設(shè)計、莒南網(wǎng)站維護等服務(wù),公司將堅持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。
1、通過命令“getenforce”獲取selinux狀態(tài),
[root@localhost ~]# getenforce Enforcing //enforceing代表開啟, [root@localhost ~]# getenforce Permissive // permissive代表警告 [root@localhost ~]# getenforce Disabled //disabled代表關(guān)閉 [root@localhost ~]#
2、在終端輸入命令即可關(guān)閉selinux,此種做法只是暫時關(guān)閉,重啟之后沒有效果
[root@localhost ~]# setenforce 0 //關(guān)閉 [root@localhost ~]# getenforce Permissive [root@localhost ~]# setenforce 1 //開啟 [root@localhost ~]# getenforce Enforcing
3、通過配置文件“/etc/sysconfig/selinux”來修改selinux狀態(tài),此種做法需要重啟機器
[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、通過修改“/boot/grub/menu.lst”來關(guān)閉selinux,這樣每次開機都不會啟動selinux
[root@localhost ~]# gedit /boot/grub/menu.lst default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu 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 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet selinux=0 initrd /initramfs-2.6.32-431.el6.i686.img
以上就是怎么關(guān)閉selinux的詳細內(nèi)容,更多請關(guān)注創(chuàng)新互聯(lián)其它相關(guān)文章!