怎么關(guān)閉selinux?
關(guān)閉selinux
1、通過(guò)命令“getenforce”獲取selinux狀態(tài),
推薦:《linux教程》
[root@localhost?~]#?getenforce Enforcing????????//enforceing代表開(kāi)啟, ? [root@localhost?~]#?getenforce Permissive??????//?permissive代表警告 ? [root@localhost?~]#?getenforce Disabled????????//disabled代表關(guān)閉 [root@localhost?~]#
2、在終端輸入命令即可關(guān)閉selinux,此種做法只是暫時(shí)關(guān)閉,重啟之后沒(méi)有效果
[root@localhost?~]#?setenforce?0????//關(guān)閉 [root@localhost?~]#?getenforce Permissive????????? ? [root@localhost?~]#?setenforce?1????//開(kāi)啟 [root@localhost?~]#?getenforce Enforcing
3、通過(guò)配置文件“/etc/sysconfig/selinux”來(lái)修改selinux狀態(tài),此種做法需要重啟機(jī)器
[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、通過(guò)修改“/boot/grub/menu.lst”來(lái)關(guān)閉selinux,這樣每次開(kāi)機(jī)都不會(huì)啟動(dòng)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
? 版權(quán)聲明
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載。
THE END