溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

關(guān)閉selinux的命令是什么

發(fā)布時間:2020-06-01 21:39:18 來源:億速云 閱讀:2743 作者:鴿子 欄目:建站服務(wù)器

關(guān)閉selinux

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)注億速云其它相關(guān)文章!

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI