资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

关闭selinux的命令是什么

关闭selinux

目前成都创新互联公司已为1000+的企业提供了网站建设、域名、网站空间、网站托管、服务器托管、企业网站设计、莒南网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

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的详细内容,更多请关注创新互联其它相关文章!


新闻标题:关闭selinux的命令是什么
网页URL:http://cdkjz.cn/article/pidcih.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220