CentOS7关闭SELINUX
安全增强型Linux(Security-Enhanced Linux)简称SELinux,它是一个 Linux 内核模块,也是Linux的一个安全子系统。为了避免安装过程出现各种错误,建议关闭,有如下两种关闭方法:
1)临时关闭(不建议使用)
[root@hadoop101 ~]# setenforce 0
但是这种方式只对当次启动有效,重启机器后会失效。
2)永久关闭(建议使用)
修改配置文件/etc/selinux/config
[root@hadoop101 ~]# vim /etc/selinux/config
将SELINUX=enforcing 改为SELINUX=disabled
# 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=disabled # SELINUXTYPE= can take one of three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
3)同步/etc/selinux/config配置文件(这一步是针对集群环境中,参考:使用集群同步脚本对配置文件同步分发)
[root@hadoop101 ~]# xsync /etc/selinux/config
4)重启主机
[root@hadoop101 ~]# reboot [root@hadoop102 ~]# reboot [root@hadoop103 ~]# reboot
分类:
Centos7
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
2020-01-13 基于Nginx实现访问控制、连接限制
2020-01-13 Tomcat线程模型分析及源码解读