无法从虚拟机外部连接到 proftpd

无法从虚拟机外部连接到 proftpd

这与上一个问题。我有一台充当服务器的机器Windows 7,它托管着几台虚拟机。其中一台Debian Squeezy充当PostgreSQL服务器,我想在同一个虚拟机中添加一个 ftp 服务器(笔记:网络适​​配器是NAT)。

由于我不知道如何连接PostgreSQLproftpd我搜索了设置 ftp 服务器的其他方法,并发现本教程来自 ubuntuforums

我遵循了安全方式(在我的虚拟机中,端口、新用户等与操作指南中的完全相同)并让 ftp 服务器运行。我FileZilla从虚拟机内部启动并使用新用户的凭据连接到 ftp。

现在,我尝试从我的电脑上执行此操作,但收到错误:"ECONNREFUSED - Connection refused by server"

VirtualBox Administrator修改了的网络设置Debian VM并转发了端口:

主机 IP:虚拟机所在机器的 IP。 访客 IP:虚拟机的内部 IP。

Protocol        HOST IP          HOST PORT   GUEST IP     GUEST PORT
----------------------------------------------------------------------
TCP             193.147.83.213   1080        10.0.2.15    1080
TCP             193.147.83.213   1980        10.0.2.15    21
TCP             193.147.83.213   21          10.0.2.15    1980

因为我可以从虚拟机内部连接到 ftp,所以我猜测这与虚拟机和我的电脑之间的通信有关。

你有什么想法?

我需要转发更多端口吗?Windows 防火墙和/或 iptables 也会造成干扰吗?

编辑1:根据@DavidHoude的要求,我使用以下输出更新了问题iptables -Lnetstat -a |监听。我必须说的配置iptables和我在 vm 中找到的一样,我没有做任何改变。

ipbles -l 复制代码

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination  

netstat -a |监听

tcp        0      0 localhost:ipp           *:*                     LISTEN     
tcp6       0      0 localhost:ipp           [::]:*                  LISTEN     
tcp6       0      0 [::]:1980               [::]:*                  LISTEN     
unix  2      [ ACC ]     STREAM     LISTENING     4563     /tmp/.X11-unix/X0
unix  2      [ ACC ]     STREAM     LISTENING     6328     /tmp/ssh-EFteMx1139/agent.1139
unix  2      [ ACC ]     STREAM     LISTENING     6370     /tmp/.ICE-unix/1139
unix  2      [ ACC ]     STREAM     LISTENING     6390     /tmp/orbit-a/linc-4d1-0-262fd8c7bf7a5
unix  2      [ ACC ]     STREAM     LISTENING     6635     /tmp/orbit-a/linc-473-0-7e706cd3d32d5
unix  2      [ ACC ]     STREAM     LISTENING     6761     /tmp/keyring-GWAtQJ/pkcs11
unix  2      [ ACC ]     STREAM     LISTENING     9031     /tmp/orbit-a/linc-5ac-0-614ad9120e41
unix  2      [ ACC ]     STREAM     LISTENING     9095     /tmp/orbit-a/linc-5b2-0-247b523c8e0b
unix  2      [ ACC ]     STREAM     LISTENING     5971     /tmp/keyring-GWAtQJ/control
unix  2      [ ACC ]     STREAM     LISTENING     6767     /tmp/keyring-GWAtQJ/ssh
unix  2      [ ACC ]     STREAM     LISTENING     6782     /tmp/orbit-a/linc-4d8-0-76e5819d5f759
unix  2      [ ACC ]     STREAM     LISTENING     4377     /var/run/cups/cups.sock
unix  2      [ ACC ]     STREAM     LISTENING     3865     /var/run/acpid.socket
unix  2      [ ACC ]     STREAM     LISTENING     7501     /tmp/orbit-a/linc-4e7-0-bece60f85ca
unix  2      [ ACC ]     STREAM     LISTENING     7334     /tmp/.esd-1000/socket
unix  2      [ ACC ]     STREAM     LISTENING     7337     /home/a/.pulse/7624943c4bf56849714f10145193c093-runtime/native
unix  2      [ ACC ]     STREAM     LISTENING     7443     /tmp/orbit-a/linc-4fd-0-c6f9eb936d6
unix  2      [ ACC ]     STREAM     LISTENING     7516     /tmp/orbit-a/linc-4e5-0-1fec0a3016600
unix  2      [ ACC ]     STREAM     LISTENING     7579     /tmp/orbit-a/linc-4f7-0-32a7a613dbfdf
unix  2      [ ACC ]     STREAM     LISTENING     7603     /tmp/orbit-a/linc-4fc-0-42c73bd03fa7f
unix  2      [ ACC ]     STREAM     LISTENING     7682     /tmp/orbit-a/linc-4e1-0-273dbd256f377
unix  2      [ ACC ]     STREAM     LISTENING     7938     /tmp/orbit-a/linc-55a-0-27cffa947264b
unix  2      [ ACC ]     STREAM     LISTENING     8030     /tmp/orbit-a/linc-55b-0-27dc07accde53
unix  2      [ ACC ]     STREAM     LISTENING     8326     /tmp/orbit-a/linc-570-0-2805454d11289
unix  2      [ ACC ]     STREAM     LISTENING     8333     /tmp/orbit-a/linc-566-0-16563300170a4
unix  2      [ ACC ]     STREAM     LISTENING     8335     /tmp/orbit-a/linc-567-0-2da4230a172b8
unix  2      [ ACC ]     STREAM     LISTENING     4395     /var/run/proftpd/proftpd.sock
unix  2      [ ACC ]     STREAM     LISTENING     8338     /tmp/orbit-a/linc-573-0-4a085d80176ac
unix  2      [ ACC ]     STREAM     LISTENING     8351     /tmp/orbit-a/linc-572-0-4206a1b81f802
unix  2      [ ACC ]     STREAM     LISTENING     8414     /tmp/orbit-a/linc-571-0-6c1f35c65e634
unix  2      [ ACC ]     STREAM     LISTENING     8443     /tmp/orbit-a/linc-4df-0-8dc2a346fe5f
unix  2      [ ACC ]     STREAM     LISTENING     8554     /tmp/orbit-a/linc-581-0-797b154e59d83
unix  2      [ ACC ]     STREAM     LISTENING     8587     /tmp/orbit-a/linc-584-0-1c5fd995d9a9a
unix  2      [ ACC ]     STREAM     LISTENING     9275     /tmp/orbit-a/linc-5cf-0-5f48faccd63f5
unix  2      [ ACC ]     STREAM     LISTENING     4403     /var/run/proftpd/proftpd.sock
unix  2      [ ACC ]     STREAM     LISTENING     2334     @/com/ubuntu/upstart
unix  2      [ ACC ]     STREAM     LISTENING     5450     @/var/run/hald/dbus-NI6LFIbNzq
unix  2      [ ACC ]     STREAM     LISTENING     5455     @/var/run/hald/dbus-87f9eAAnp3
unix  2      [ ACC ]     STREAM     LISTENING     3412     /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     4562     @/tmp/.X11-unix/X0
unix  2      [ ACC ]     STREAM     LISTENING     6369     @/tmp/.ICE-unix/1139
unix  2      [ ACC ]     STREAM     LISTENING     3489     /var/run/avahi-daemon/socket
unix  2      [ ACC ]     STREAM     LISTENING     4781     @/tmp/gdm-session-UHdjqzQA
unix  2      [ ACC ]     STREAM     LISTENING     4639     @/tmp/gdm-greeter-mvMQrpxI
unix  2      [ ACC ]     STREAM     LISTENING     6341     @/tmp/dbus-KUrgd752tT

编辑2:根据@dusan.bajic 的建议,我将其添加MasqueradeAddress 193.147.83.213proftpd.conf文件中。

现在 FileZilla 输出以下内容:

Estado: Connecting to 193.147.83.213:1980...
Estado: Connection established, waiting for welcoming message...
Error:  Couldn't connect to server

我可能会说我在 Windows 机器上使用 FileZilla,如下所示:

Server: 193.147.83.213
User: sauron
Port: 1980

编辑2:

@dusan.bajic 说得有道理。我禁用了防火墙,然后发生了以下情况:

Resposne:   331 Password required for sauron
Command:    PASS ******
Response:   230 welcome !!!
Command:    SYST
Response:   215 UNIX Type: L8
Command:    FEAT
Response:   211-Features:
Response:    MDTM
Response:    MFMT
Response:    UTF8
Response:    LANG en-US.utf8*
Response:    MFF modify;UNIX.group;UNIX.mode;
Response:    MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
Response:    REST STREAM
Response:    SIZE
Response:   211 End
Command:    OPTS UTF8 ON
Response:   200 UTF8 set to on
Status: Connected
Status: Retrieving directory listing...
Command:    PWD
Response:   257 "/" is the current directory
Command:    TYPE I
Response:   200 Type set to I
Command:    PASV
Response:   227 Entering Passive Mode (193,147,83,213,152,251).
Command:    MLSD
Error:  Connection timeout exceeded
Error:  Error retrieving directory listing

因此看起来它已经连接了,但是在输入时passive mode(顺便问一下,括号里的数字是什么?端口?)

相关内容