vsftp报错425 Failed to establish connection

简介:

转自http://blog.sina.com.cn/s/blog_4da051a60101c8ny.html

     vsftp:425 failed to establish connection解决办法


错误:

425 Failed to establish connection.


这时候,可以在ftp下使用命令:quote PASV


试试用以被动模式连接。


一般DOS命令行下都是默认以PORT主动模式连接。


即,端口21监听,处理控制信息,再以端口20连接客户端进行数据传送。


而,经常的,通过外网的NAT的,基本端口20的数据连接都会被禁止掉。


所以,如果想对外网开放ftp,最好使用PASV模式。


PASV被动模式是指,以端口21监听,有连接请求时,随机开放一个比较大的端口号来处理数据传输。



vsftp中,通过编辑 /etc/vsftp.conf 实现启用PASV连接。


sudo vi /etc/vsftp.conf


在配置文件中添加下面语句:


pasv_enable=YES

pasv_min_port=6000

pasv_max_port=7000


也即,启动PASV连接模式,开放6000-7000端口号作为数据传送端口。


此外,如果是对外网开放,必须在路由器的转发规则中,开放21端口。


为了保险,可以将6000-7000端口也写入到iptables中白名单中。


命令:


sudo iptables -A INPUT -p tcp --dport 6000:7000 -j ACCEPT


在ubuntu中一般可以不用,因为ubuntu虽然有iptables,但默认是没有规则的,


也即,不会设置端口限制,但其他版本就最好加上哈。


此外,如果带有selinux的,最好也关闭。


ubuntu是默认没安装selinux。


像redhat、centOS之类的,


修改/etc/selinux/config文件中的SELINUX="" 为disabled ,然后重启。 


这样设定后,一般就可以搞定了。


如果还不行,可以通过一下思路:


1、防火墙(本机、客户机)


2、FTP目录的权限


3、客户机是否是IPv6网络


4、客户机的网关限制了外网ftp

本文转自 wdy198622 51CTO博客,原文链接:http://blog.51cto.com/weimouren/1842495


相关文章
|
4月前
|
Go 开发工具 git
【git】解决:Failed to connect to 127.0.0.1 port 7890: Connection refused
【git】解决:Failed to connect to 127.0.0.1 port 7890: Connection refused
516 0
mac安装homebrew失败:Failed to connect to raw.githubusercontent.com port 443: Connection refused
mac安装homebrew失败:Failed to connect to raw.githubusercontent.com port 443: Connection refused
|
Java 应用服务中间件 PHP
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
373 0
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
|
11月前
|
jenkins 持续交付 网络安全
2. 成功解决 BUG:Exception when publishing, ...[Failed to connect and initialize SSH connection...
SSH: Connecting from host [WIN-...] SSH: Connecting with configuration [192.168....] ... ERROR: Exception when publishing, exception message [Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [192.168....]. Message [java.net.ConnectException: Connection
1045 0
|
数据安全/隐私保护
记录curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused解决方案
关于这个错误其实遇到过好多次了,基本都是在每次换电脑之后执行
记录curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused解决方案
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
161 0
|
Linux
七个办法只有一个有效:200 PORT command successful. Consider using PASV.425 Failed to establish connection.
七个办法只有一个有效:200 PORT command successful. Consider using PASV.425 Failed to establish connection.
420 0
七个办法只有一个有效:200 PORT command successful. Consider using PASV.425 Failed to establish connection.
Failed to connect to 127.0.0.1 port 1080: Connection refused package 问题解决方法
Failed to connect to 127.0.0.1 port 1080: Connection refused package 问题解决方法
660 0
Failed to connect to 127.0.0.1 port 1080: Connection refused package 问题解决方法
|
网络协议
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused解决方案
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused解决方案
424 0
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused解决方案
|
Linux 测试技术 网络安全
VNC connect:Connection refused(10061)
在Windows机器上使用VNC Viewer访问Linux服务器,有时候会遇到"connect:Connection refused(10061)"这个错误,导致这个错误出现的原因有多重,下面总结一下:     1:使用VNC Viewer时忘记加桌面号(一般为IP:桌面号,桌面号要看你自己的配置而定。
4148 0