关闭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. node项目部署相关问题

    process.env process.env属性返回一个对象,包含了当前Shell的所有环境变量. 通常的做法是,新建一个环境变量NODE_ENV,用它确定当前所处的开发阶段,生产阶段设为produ ...

  2. stylie工具轻松搞定css3抛物线动画

    自从CSS3引入了动画(transition和@keyframes,还有与之搭配的transform)之后,写动画也变的越来多越来越容易. 可是当我们遇到需要利用数学公式的复杂动画时,却一筹莫展,只能 ...

  3. CentOS 6U7分区大于2TB的磁盘以及挂载大于16TB分区磁盘的解决方案

    一.内容介绍1.问题描述1).问题一 CentOS 6.x 在格式化大于16TB的ext4分区时,会提示如下错误: mke2fs 1.41.12 (17-May-2010)mkfs.ext4: Siz ...

  4. 【转】.NET Framework、C#语言、IDE、CLR 版本历史及其差异

    原文地址: http://www.cnblogs.com/PurpleCow/archive/2012/06/17/2552780.html http://www.cnblogs.com/lhking ...

  5. Oracle体系结构之控制文件管理

    控制文件作用:记录了数据库的结构和行为,有多少个数据文件,日志文件及其位置名称,状态,维护数据库的一致性,即记录了数据库的启动SCN号和终止SCN号. 控制文件的位置和个数记录在参数文件中,通常控制文 ...

  6. Taking a peek inside with the Actuator

    Taking a peek inside with the Actuator <dependency> <groupId>org.springframework.boot< ...

  7. 【pip uninstall 无法卸载】Not uninstalling numpy at /usr/lib/python2.7/dist-packages, outside environment /usr

    想卸载python的库numpy,执行pip uninstall gunicorn,报错如下: Not uninstalling numpy at /usr/lib/python2.7/dist-pa ...

  8. PyQt5标准对话框

    很全的Qt的标准对话框,包含QInputDialog.QColorDialog.QFontDialog.QMessageBox.QOpenFileDialog... 全部是由官网的C++版本,转换成P ...

  9. (四)Web应用开发---新增对象Master类别

    UI设计类似如下形式 Copy如下Html代码到新创建的Html <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xh ...

  10. 2018中国(深圳)IT领袖峰会马化腾演讲全文《数字中国的机遇与探索》

    我们今天大会的主题是数字中国,也佩服我们吴鹰主席在十年前就想到发展的趋势,这么早就把我们联合会取名数字中国.昨天有一个闭门会议,有相当大的篇幅大家都谈了科技.谈创新,大家觉得科技的威力和优势越来越明显 ...