CENTOS关闭selinux的方法

selinux其实挺烦的,有它在,连给正常服务改个端口都不行。比方说给ssh改其他端口,改完后重启sshd服务会提示:Job for sshd.service failed because the control process exited with error code. See “systemctl status sshd.service” and “journalctl -xe” for details. 这就是selinux造成的。关闭selinux的方法:

1、临时关闭,即时生效,不需要重启服务器:setenforce 0

2、永久关闭,重启服务器才能生效:sed i ‘/SELINUX/s/enforcing/disabled/’ /etc/selinux/config

 

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片快捷回复

    暂无评论内容