如何设置SElinux
1. [root@localhost ~]# getenforce
如果为disabled 就是已经关闭,如果enforce 就是强制的模式
(1)不重启的头闭 [root@localhost ~]# setenforce 0 #重启电脑后失效
(2)重启电脑的关闭 [root@localhost ~]# vi /etc/selinux/config
把SELINUX=enforce 改成disabled就可以了,重启电脑,永久生效
如何关闭Linux里边的selinux
[root@123]# vim /etc/selinux/config
# 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=enforcing????????将此行更改
SELINUX=permissive????????
# SELINUXTYPE= can take one of these two values:
# ? ? targeted - Targeted processes are protected,
# ? ? mls - Multi Level Security protection.
SELINUXTYPE=targeted
----------------------
临时关闭可用使用#setenforce 0
如何开启或关闭SELinux
查看SELinux状态:
1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态
SELinux status: enabled
2、getenforce ##也可以用这个命令检查
关闭SELinux:
1、临时关闭(不用重启机器):
setenforce 0 ##设置SELinux 成为permissive模式
##setenforce 1 设置SELinux 成为enforcing模式
2、修改配置文件
vim /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled
重启机器即可
如何关闭手机的SELinux
/usr/bin/setenforce 是用来修改selinux的实时运行模式的
临时打开:
setenforce 1----设置selinux 成为enforcing模式
临时关闭:
setenforce 0----设置selinux 成为permissive模式
如果要彻底禁用selinux 需要在/etc/sysconfig/selinux中设置参数selinux=0 ,或者在/etc/grub.conf中添加这个参数
/usr/bin/setstatus -v
如何解决SELinux问题
上面有个小错,应该是echo "0" > /selinux/enforce (少了>)selinux如果有开很容易造成ifind问题,参看下面系统日志Aug 2 20:52:-lnx-imglib setroubleshoot: SELinux is preventing /opt/simpana/iDataAgent/ifind "execstack" ess to . plete SELinux messages. run sealert -l 4a0b3993-b18f-4c72-9e1d-4f5d8175ad41Jul 31 00:30:-lnx-imglib setroubleshoot: SELinux is preventing /bin/hostname ess to a leaked /tmp/.gxsetup/cvpkglo g.pipe.26262 file descriptor. plete SELinux messages. run sealert -l e675a6a6-efc9-461f-b794-784c0fd2d308