溫馨提示×

溫馨提示×

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

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

關閉selinux的命令是什么

發布時間:2020-06-01 21:39:18 來源:億速云 閱讀:2788 作者:鴿子 欄目:建站服務器

關閉selinux

1、通過命令“getenforce”獲取selinux狀態,

[root@localhost ~]# getenforce
Enforcing        //enforceing代表開啟,
 
[root@localhost ~]# getenforce
Permissive      // permissive代表警告
 
[root@localhost ~]# getenforce
Disabled        //disabled代表關閉
[root@localhost ~]#

2、在終端輸入命令即可關閉selinux,此種做法只是暫時關閉,重啟之后沒有效果

[root@localhost ~]# setenforce 0    //關閉
[root@localhost ~]# getenforce
Permissive         
 
[root@localhost ~]# setenforce 1    //開啟
[root@localhost ~]# getenforce
Enforcing

3、通過配置文件“/etc/sysconfig/selinux”來修改selinux狀態,此種做法需要重啟機器

[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”來關閉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

以上就是怎么關閉selinux的詳細內容,更多請關注億速云其它相關文章!

向AI問一下細節

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

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女