码迷,mamicode.com
首页 > 系统相关 > 详细

如何开启或关闭SELinux

时间:2015-03-12 15:10:38      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:

查看selinux

[root@mode ~]# getenforce
Disabled
[root@mode ~]# /usr/sbin/sestatus -v
SELinux status:                 disabled

临时关闭selinux
[root@mode ~]# setenforce 0
setenforce: SELinux is disabled

永久关闭selinux的两种方式

[root@mode ~]# vi /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 - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted
~
~

第二种方式:

~
[root@mode ~]# cat /boot/grub/menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda3
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
password --md5 $1$P6MX17N9$upRaE9GPh/J6Y2.weHY7B0
title CentOS (2.6.18-308.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-308.el5 ro root=LABEL=/ selinux=0
        initrd /initrd-2.6.18-308.el5.img

如何开启或关闭SELinux

标签:

原文地址:http://blog.csdn.net/u014236541/article/details/44220987

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!