如何开启或关闭SELinux


查看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

相关内容

    暂无相关文章