以往用centos,防火墙都是firewall,一直没有接触iptables。
这次用虚拟机安装测试CentOS系统后,vsftpd启动,selinux、firewalld关闭,ftp却无论如何连接不上,一直提示连接超时。
最后发现,原来系统中还启动了iptables(为何启动的?什么时候安装的?均不知)
原想卸载iptables,上网查询后发现运行yum -y remove iptables会删除很多依赖组件
如果不需使用iptables,只需将其停止或是清楚规则即可。
停止:
systemctl stop iptables
禁用:
systemctl disabled iptables
停止或禁用后 ftp连接正常。
另附上关闭firewall及selinux的方法
停止firewall:
systemctl stop firewalld.service
禁用firewall:
systemctl disable firewalld.service
临时关闭selinux:
setenforce 0
永久关闭selinux:
vi /etc/selinux/config
SELINUX=disabled
设置后需要重启系统
查看selinux启动状态:
getenforce
更多精彩内容:各种AI课程、技能课程、黑科技软件、网站小程序源码、副业小项目、PPT模板等精品素材、电商课程、推广引流课程等,尽在 天边资源网 。