关闭selinux

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 LANG=zh_CN.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

 

Linux服务器---关闭selinux的更多相关文章

  1. linux如何关闭selinux?

    首先我们可以用命令来查看selinux的状态getenforce 这个命令可以查看到selinux的状态,当前可以看到是关闭状态的.还有一个命令也可以查看出selinux的状态.sestatus -v ...

  2. linux下关闭selinux

    找到 /etc/sysconfig/selinux 文件 修改 SELINUX=enable 使之 SELINUX=disable 重启 reboot

  3. 【Linux】关闭selinux

    vi /etc/selinux/config 将SELINUX=enforcing改为SELINUX=disabled 设置后需要重启才能生效

  4. linux服务器关闭ipv6 方法

    第一个文件: /etc/sysconfig/network 第二个文件:如无此文件,vim添加 /etc/modprobe.d/disable_ipv6.conf

  5. Linux 服务器 关闭FTP匿名访问

    service vsftpd status //查看FTP运行状态 vim /etc/vsftpd/vsftpd.conf //修改配置文件 找到vsftpd.conf中的 anonymous_ena ...

  6. Linux下开启关闭SeLinux

    SELinux (Security-Enhanced Linux) in Fedora is an implementation of mandatory access control in the ...

  7. 如何关闭Linux里边的selinux ?

    原文地址: http://jingyan.baidu.com/article/6d704a131ba67828da51ca73.html 有很多的Linux使用者因为对selinux不熟悉,所以都会将 ...

  8. Linux关闭selinux

    最近在折腾Linux服务器,配置环境时,安装php的一个拓展,明明编译成功了,就是加载不进去,phpinfo不显示,查看错误日志是显示加载失败,没权限==,配置ftp程序也会有意想不到的问题,搞了好久 ...

  9. linux 为什么要关闭selinux

    一般安装linux课程时都把SELinux与iptables安排在后面,使初学者配置linux服务器时不成功,却没有头绪,那是因为在RedHat linux操作系统中默认开启了防火墙,SELinux也 ...

随机推荐

  1. url分发、isinstance、request.GET请求之QueryDict和urlencode、post和get请求、limit_choices_to(Model字段)

    这个的路径是怎么来的,是有一个个的url路由分发过来的 这两个是相等的,若url后面加括号了,那么前面就不用这个装饰器了:反之,若装饰器使用了,那么这个url后面就不要加括号了 eg:其他的views ...

  2. 7.20python线程(2)

    RLock 递归锁 线程事件

  3. jquery 设置style:display 其实很方便的哦

    ("#id").css('display','none'); $("#id").css('display','block'); 或 $("#id&qu ...

  4. ELK之nginx日志使用json格式输出

    json Nginx默认日志输出格式为文本非json格式,修改配置文件即可输出json格式便于收集以及绘图 修改nginx配置文件添加配置,增加一个json输出格式的日志格式 log_format a ...

  5. Flask 学习篇一: 搭建Python虚拟环境,安装flask,并设计RESTful API。

    前些日子,老师给我看了这本书,于是便开始了Flask的学习 GitHub上的大神,于是我也在GitHub上建了一个Flask的项目. 有兴趣可以看看: https://github.com/Silen ...

  6. 【转】JavaScript prototype

    原文地址:http://www.cnblogs.com/dolphinX/p/3286177.html 用过JavaScript的同学们肯定都对prototype如雷贯耳,但是这究竟是个什么东西却让初 ...

  7. 2018No-java面试知识

    1.框架 1. springboot比spring的优点? 2. Springmvc的基本流程? 3. 微服务之间调用不会慢吗? 4. 大图片和大数据库怎么存储? 5. spring事物?四大特征, ...

  8. 软件工程-wordcount(C语言实现)

    Github项目地址:https://github.com/xiaobaot/wordcount-wc/tree/master WC 项目要求 wc.exe 是一个常见的工具,它能统计文本文件的字符数 ...

  9. Spark-自定义排序

    一.自定义排序规则-封装类 import org.apache.spark.rdd.RDD import org.apache.spark.{SparkConf, SparkContext} /** ...

  10. maven报错集

    1.install报错解决[致命错误: 在类路径或引导类路径中找不到程序包 java.lang] Windows分隔符英文分号 <bootclasspath>${java.home}/li ...