与在RHEL或Centos中一样,我们可以通过以下方式永久地建立加载端口或服务:
firewall-cmd --reload.
但是目前我正在研究ubuntu 16.04,但是我对此并不了解。
因此,请告诉我在防火墙中添加端口或服务并使其永久不变。
我正在使用命令:
sudo ufw allow https or 443/tcp
在RHEL或CENTOS中是否相同?
与在RHEL或Centos中一样,我们可以通过以下方式永久地建立加载端口或服务:
firewall-cmd --reload.
但是目前我正在研究ubuntu 16.04,但是我对此并不了解。
因此,请告诉我在防火墙中添加端口或服务并使其永久不变。
我正在使用命令:
sudo ufw allow https or 443/tcp
在RHEL或CENTOS中是否相同?
Ubuntu 16.04 does not use
firewalld
by default such as RHEL/Centos which is whyfirewall-cmd --reload
will not work . So you have 3 options:1)通过以下方式切换到firewalld:
sudo systemctl stop iptables sudo systemctl mask iptables sudo apt-get remove ufw apt install firewalld sudo systemctl enable firewalld
2)通过以下方式使用iptables:
iptables -I INPUT -p tcp --d-port 443 -j ACCEPT
3)通过以下方式使用UFW:
sudo ufw allow 443