在gfs2中关闭selinux,gfs2关闭selinux


在构建iSCSI存储集群时,请勿在gfs2中使用selinux


怎关闭SELinux

一般安装linux课程时都把SELinux与iptables安排在后面,使初学者配置linux服务器时不成功,却没有头绪,那是因为在RedHat linux操作系统中默认开启了防火墙,SELinux也处于启动状态,一般状态为enforing。致使很多服务端口默认是关闭的。所以好多服务初学者明明配置文件正确,等验证时有时连ping也ping不通。建议初学者在未学到SELlinux与iptables之前,配置服务器把这两项都关掉。那么怎么关呢?1、关闭iptables#service iptables stop2、关闭SELinux#vi /etc/selinux/config将文件中的SELINUX="" 为 disabled ,然后重启。如果不想重启系统,使用命令setenforce 0注:setenforce 1 设置SELinux 成为enforcing模式setenforce 0 设置SELinux 成为permissive模式在lilo或者grub的启动参数中增加:selinux=0,也可以关闭selinux#---------------------------------------------------------------查看selinux状态:/usr/bin/setstatus -v如下:SELinux status: enabledSELinuxfs mount: /selinuxCurrent mode: permissiveMode from config file: enforcingPolicy version: 21getenforce/setenforce查看和设置SELinux的当前工作模式
 

怎关闭SELinux

代码片段(1)[全屏查看所有代码]1. [代码][Shell/批处理]代码 1、快速关闭SElinux,使用如下命令就可以: /usr/sbin/setenforce 0 立刻关闭 SELINUX /usr/sbin/setenforce 1 立刻启用 SELINUX 2、加到系统默认启动里面 echo "/usr/sbin/setenforce 0" >> /etc/rc.local 3、可以编辑配置文件达到同样的目的 vi /etc/selinux/conf set SELINUX=disabled
 

相关内容