我需要更改selinux在生产服务器上的“宽容模式”,而不用重新启动,但setenforce不会让我这样做(作为根),它总是打印“setenforce:SELinux被禁用”我做错了什么?
[root@server3 ~]# setenforce 0 setenforce: SELinux is disabled [root@server3 ~]# setenforce 1 setenforce: SELinux is disabled [root@server3 ~]# setenforce Permissive setenforce: SELinux is disabled [root@server3 ~]# getenforce Disabled
setenforce只能用于更改 SELinux运行的模式。它不能用于启用SELinux。
所以,SELinux必须首先启用如下:
sudo nano /etc/selinux/config
然后改变
SELINUX=disabled
成
SELINUX=permissive
并重新启动。
重启后,你应该有
# getenforce Permissive
据我所知,这是不可能的 。
SELinux是内核的一个核心特性,意味着它的状态改变总是要求重启被设置为启用或禁用。