阿里云防火墙配置,多种设置方式,搭配ftp服务器,解决网页打不开问题

阿里云centos7.6自带防火墙就是fireward,我自己又配置了iptables,我刚开始没有弄懂,以为两个是不一样的,导致总是两个都打不开,要是单纯的开firwward也是可以的,但是我更喜欢iptables配置文件来查看相关配置
ftp服务器网页打不开的问题探究,通过反复运行,找到自己问题所在

vim /etc/sysconfig/iptables

都要开
在这里插入图片描述

systemctl restart iptables.service
systemctl enable iptables.service

注意下面为错误示范,当时没有理解!
防火墙设置
这里iptables设置就是防火墙参数,没有必要再添加firewall参数了,反而打不开
在这里插入图片描述

同时我也添加一些参数,确实打不开,终于搞清不能两个同时配置
下面参数不用加
systemctl restart firewalld.service
firewall-cmd --permanent --list-port
firewall-cmd --zone=public --add-port=22/tcp--permanent
firewall-cmd --zone=public--add-port=21/tcp --permanent
systemctl restart firewalld
firewall-cmd --permanent --list-port

下面是以前打开的端口,我测试了下,果然不能同时测试,打不开的网页就不发了
在这里插入图片描述
那么下面就直接运行已有的iptables配置就行

systemctl restart iptables.service
systemctl enable iptables.service
systemctl restart vsftpd.service

打开网页输入你账户,密码登录即可

在这里插入图片描述

发布了7 篇原创文章 · 获赞 6 · 访问量 1699

猜你喜欢

转载自blog.csdn.net/weixin_43464303/article/details/104364429
今日推荐