我已经在我的家用机器上启动并运行了 pureftp。我正在尝试使用 filezilla 从网络外部连接到它。一切似乎都很顺利,但 filezilla 无法连接。这是 filezilla 显示的唯一日志,是什么阻止连接成功?
2016-05-04 09:10:23 17108 1 Status: Resolving address of XXX.XXX.XXXX.org
2016-05-04 09:10:23 17108 1 Status: Connecting to XX.XX.XXX.XXX:81...
2016-05-04 09:10:23 17108 1 Status: Connection established, waiting for welcome message...
2016-05-04 09:10:43 17108 1 Error: Connection timed out after 20 seconds of inactivity
2016-05-04 09:10:43 17108 1 Error: Could not connect to server
我正在连接到一个主机名,该主机名已转发到我的 WAN IP,端口 81 已定向到我的 LAN IP。
编辑
如果我在服务器计算机上打开终端并键入ftp XXX.XXX.XXXX.org
输出终端给出的是
Request timed out
所以看来我什至无法连接到我的本地计算机。我在设置 ftp 时错过了一个步骤吗?
编辑2
如果我运行命令,ftp 127.0.0.1
输出是
owner@OwnerBackup:~$ ftp 127.0.0.1<br>
Connected to 127.0.0.1.<br>
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------<br>
220-You are user number 1 of 50 allowed.<br>
220-Local time is now 10:37. Server port: 21.<br>
220-This is a private system - No anonymous login<br>
220-IPv6 connections are also welcome on this server.<br>
220 You will be disconnected after 15 minutes of inactivity.<br>
Name (127.0.0.1:owner): <br>
编辑3
IP表如下:
owner@OwnerBackup:~$ sudo iptables -L<br>
[sudo] password for owner: <br>
Chain INPUT (policy ACCEPT)<br>
target prot opt source destination <br>
<br>
Chain FORWARD (policy ACCEPT)<br>
target prot opt source destination <br>
<br>
Chain OUTPUT (policy ACCEPT)<br>
target prot opt source destination <br>
至于端口转发,我需要转发哪些端口?意思是,我有一个 FTP 服务器启动并在另外 2 个 LAN IP 上运行...
端口 20 - 21 转发到以 .300 结尾的 LAN IP
端口 990 - 999 转发到以 .350 结尾的 LAN IP
端口 2000 - 2100 转发到 LAN IP以 .360 结尾(本机)
编辑#4
按照我的一个答案中列出的建议,我没有更改服务器侦听的默认侦听端口。改变这样,现在当我尝试连接时,这是我得到的错误日志。我需要做什么才能成功连接?
2016-05-04 14:46:49 15764 1 Status: Resolving address of XXX.XXX.XXXX.org
2016-05-04 14:46:49 15764 1 Status: Connecting to 9XX.XX.XXX.XXX:2050...
2016-05-04 14:46:49 15764 1 Status: Connection established, waiting for welcome message...
2016-05-04 14:46:49 15764 1 Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
2016-05-04 14:46:49 15764 1 Response: 220-You are user number 2 of 50 allowed.
2016-05-04 14:46:49 15764 1 Response: 220-Local time is now 14:46. Server port: 2050.
2016-05-04 14:46:49 15764 1 Response: 220-This is a private system - No anonymous login
2016-05-04 14:46:49 15764 1 Response: 220-IPv6 connections are also welcome on this server.
2016-05-04 14:46:49 15764 1 Response: 220 You will be disconnected after 15 minutes of inactivity.
2016-05-04 14:46:49 15764 1 Command: AUTH TLS
2016-05-04 14:46:49 15764 1 Response: 500 This security scheme is not implemented
2016-05-04 14:46:49 15764 1 Command: AUTH SSL
2016-05-04 14:46:49 15764 1 Response: 500 This security scheme is not implemented
2016-05-04 14:46:49 15764 1 Status: Insecure server, it does not support FTP over TLS.
2016-05-04 14:46:49 15764 1 Command: USER baduser
2016-05-04 14:46:49 15764 1 Response: 331 User baduser OK. Password required
2016-05-04 14:46:49 15764 1 Command: PASS *******
2016-05-04 14:46:51 15764 1 Response: 230 OK. Current directory is /
2016-05-04 14:46:51 15764 1 Command: OPTS UTF8 ON
2016-05-04 14:46:51 15764 1 Response: 200 OK, UTF-8 enabled
2016-05-04 14:46:51 15764 1 Status: Logged in
2016-05-04 14:46:51 15764 1 Status: Retrieving directory listing...
2016-05-04 14:46:51 15764 1 Command: PWD
2016-05-04 14:46:51 15764 1 Response: 257 "/" is your current location
2016-05-04 14:46:51 15764 1 Command: TYPE I
2016-05-04 14:46:51 15764 1 Response: 200 TYPE is now 8-bit binary
2016-05-04 14:46:51 15764 1 Command: PASV
2016-05-04 14:46:51 15764 1 Response: 227 Entering Passive Mode (XXX,XXX,X,XX,XX,XXX)
2016-05-04 14:46:51 15764 1 Status: Server sent passive reply with unroutable address. Using server address instead.
2016-05-04 14:46:51 15764 1 Command: MLSD
2016-05-04 14:47:03 15764 1 Error: Directory listing aborted by usercd
答案1
有几件事需要仔细检查:
1) 您可以在本地连接
2) 您可以从终端 ftp 127.0.0.1
3) 您在路由器中为端口范围设置端口转发
4) 您将 ftp 服务器的默认侦听端口更改为镜像路由器中设置的范围内的端口之一。
根据我的经验,当我遇到 FTP 问题时,它源于上述原因之一,通常是第四个!