防火墙和SELinux相关

防火墙相关操作

临时关闭防火墙

systemctl stop firewalld

永久防火墙开机自动关闭

systemctl disable firewalld

临时打开防火墙

systemctl start firewalld

防火墙开机启动

systemctl enable firewalld

查看防火墙状态

systemctl status firewalld

Sellinux相关操作

临时关闭SELinux

setenforce 0 (0为关闭 1为开启)

临时打开SELinux

setenforce 1

查看SELinux状态

getenforce

开机关闭SELinux
编辑/etc/selinux/config文件
将SELINUX的值设置为disabled
下次开机SELinux就不会启动了。
注意,此时将不能通过setenforce 1命令临时打开。

> [root@localhost ~]# setenforce 1 
> setenforce: SELinux is disabled

猜你喜欢

转载自blog.csdn.net/planetoid_a/article/details/108948717