Centos7在SSH终端执行以下命令:
- yum install firewall -y
- systemctl enable firewalld
- systemctl start firewalld
- firewall-cmd --permanent --zone=public --add-port=20/tcp
- firewall-cmd --permanent --zone=public --add-port=21/tcp
- firewall-cmd --permanent --zone=public --add-port=22/tcp
- firewall-cmd --permanent --zone=public --add-port=80/tcp
- firewall-cmd --permanent --zone=public --add-port=888/tcp
- firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
- firewall-cmd --reload
复制代码 |