修改防火墙设置
vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT # 加入这一行打开21端口
重启防火墙
service iptables stop
service iptables start
centOs7
查看防火墙状态
systemctl status firewalld.service
关闭防火墙
systemctl stop firewalld.service
禁用防火墙服务
systemctl disable firewalld.service