Linux 基础(5) - 防火墙设置

1. 关闭启动防火墙

1.1 查看防火墙状态

systemctl status firewalld

1.2 关闭防火墙

systemctl stop firewalld

1.3 启动防火墙

systemctl start firewalld

1.4 开机自动关闭防火墙

systemctl disable firewalld      (CentOS7)
chkconfig --list|grep network    (CentOS6)

1.5 开机自动开启防火墙

systemctl enable firewalld      (CentOS7)
chkconfig --list|grep network    (CentOS6)

2.临时和永久关闭Selinux

2.1 临时关闭Selinux

getenforce
setenforce 0

2.2 永久关闭Selinux

1). 修改 SELINUX=enforcing 为 SELINUX=disabled

vim /etc/selinux/config


2).重启服务器

reboot

posted @ 2021-07-26 10:15  自然有道  阅读(339)  评论(0编辑  收藏  举报