Linux服务器---关闭selinux

简介:
关闭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

相关文章
|
7天前
|
Java Linux
Springboot 解决linux服务器下获取不到项目Resources下资源
Springboot 解决linux服务器下获取不到项目Resources下资源
|
10天前
|
Linux
linux下搭建tftp服务器教程
在Linux中搭建TFTP服务器,需安装`tftp-server`(如`tftpd-hpa`)。步骤包括:更新软件包列表,安装`tftpd-hpa`,启动并设置开机自启,配置服务器(编辑`/etc/default/tftpd-hpa`),添加选项,然后重启服务。完成后,可用`tftp`命令进行文件传输。例如,从IP`192.168.1.100`下载`file.txt`: ``` tftp 192.168.1.100 <<EOF binary put file.txt quit EOF ```
24 4
|
24天前
|
Linux Shell 网络安全
【Shell 命令集合 网络通讯 】Linux 与SMB服务器进行交互 smbclient命令 使用指南
【Shell 命令集合 网络通讯 】Linux 与SMB服务器进行交互 smbclient命令 使用指南
40 1
|
26天前
|
域名解析 存储 网络协议
Linux中搭建主从DNS服务器
搭建主从DNS架构以提升DNS服务的高可用性、负载均衡和数据冗余。主服务器配置涉及编辑`/etc/named.conf`,设置监听IP和允许查询的范围,并定义主区域及允许的数据传输。从服务器配置需指定为奴隶类型,并指明主服务器的IP。测试表明正反向查询解析均正常。注意配置文件的语法正确性和权限设置。
|
2天前
|
Linux 数据安全/隐私保护
Linux基础与服务器架构综合小实践
【4月更文挑战第9天】Linux基础与服务器架构综合小实践
261 6
|
14天前
|
Ubuntu Linux 虚拟化
【Linux】ubuntu安装samba服务器
【Linux】ubuntu安装samba服务器
|
15天前
|
Linux
Linux安装bind9搭建自己的域名服务器
Linux安装bind9搭建自己的域名服务器
10 0
|
17天前
|
网络协议 Linux 网络安全
Linux服务器DNS服务器配置实现bind的正向解释和反向解释
Linux服务器DNS服务器配置实现bind的正向解释和反向解释
17 0
|
24天前
|
网络协议 安全 Shell
【Shell 命令集合 系统设置 】Linux 从远程时间服务器获取当前日期和时间 rdate命令 使用指南
【Shell 命令集合 系统设置 】Linux 从远程时间服务器获取当前日期和时间 rdate命令 使用指南
31 0
|
24天前
|
Shell Linux 网络安全
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
28 0