1.先关闭防火墙:
systemctl stop firewalld
之后会输入用户密码
2.查看防火墙的状态
systemctl status firewalld
之后会看到firewalld的状态Active:inactive
3.打开防火墙
systemctl start firewalld
4.禁用防火墙
systemctl disable firewalld
关闭SELinux服务,需要修改/etc/selinux/config文件
config文件可能处于only read状态,设置权限chmod 777 config 给与可读可写权限。有可能需要进入使用root来更改。
查看SELinux状态:
1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态
SELinux status: enabled
2、getenforce ##也可以用这个命令检查
关闭SELinux:
1、临时关闭(不用重启机器):
setenforce 0 ##设置SELinux 成为permissive模式
##setenforce 1 设置SELinux 成为enforcing模式
2、修改配置文件需要重启机器:
修改/etc/selinux/config 文件
cd /etc/selinux
gedit config
将SELINUX=enforcing改为SELINUX=disabled
修改完保存即可
重启机器即可