425 Failed to establish connection.

问题描述

  • 使用ftp命令测试发现,可以正常登录,但不能使用lsdir等命令
PS C:\Users\dadei> ftp 192.168.0.15
连接到 192.168.0.15。
220 Welcome to lmes FTP service.
200 Always in UTF8 mode.
用户(192.168.0.15:(none)): dduan
331 Please specify the password.
密码:
230 Login successful.
ftp> ls
200 PORT command successful. Consider using PASV.
425 Failed to establish connection.

问题原因

200 PORT command successful. Consider using PASV.
425 Failed to establish connection.

提示信息可以知道,主要问题在端口被防火墙控住

解决办法

CentOS、RedHat

  • 修改/etc/selinux/config文件中的SELINUX="为disabled",然后重启
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

Ubuntu

  • /etc/vsftpd/vsftpd.conf添加如下内容
# 开启被动模式
pasv_enable=YES
# 被动模式最小端口
pasv_min_port=6000
# 被动模式最大端口
pasv_max_port=7000
  • 将6000-7000端口也写入到iptables中白名单中
sudo iptables -A INPUT -p tcp --dport 6000:7000 -j ACCEPT
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

dadeity

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值