This is related to a previous question. I have a machine with Windows 7
acting as a server and it hosts several virtual machines. One of them, a Debian Squeezy
is acting as a PostgreSQL
server and I want to add a ftp server in that same virtual machine (Note: the network adaptor is NAT).
Since I can't figure out how to connect PostgreSQL
and proftpd
, I searched for other ways of setting up the ftp server and found this tutorial in ubuntuforums.
I followed all the steps in the SECURE WAY (in my vm, the port, the new user, etc. are exactly the same as those in the howto) and got the ftp server running. I launched FileZilla
from inside the virtual machine and connected to the ftp with the new user's credentials.
Now, I tried to do it from the my pc, but received an error: "ECONNREFUSED - Connection refused by server"
.
In the VirtualBox Administrator
I modified the networking settings of the Debian VM
and forwarded the ports:
HOST IP: The ip of the machine where is located the vm. GUEST IP: The vm's internal 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
Since I can connect to the ftp from inside the vm, I guess this has something to do with the comunnication between the virtual machine and my pc.
Do you have any ideas?
Do I need to forward more ports? Might the Windows firewall and/or iptables be interfering too?
EDIT 1: As requested by @DavidHoude, I updated the question with the outputs of iptables -L and netstat -a | grep LISTEN. I must say that the configuration of iptables
is the same I found in the vm, I didn't change a bit.
iptbles -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 | grep LISTEN
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
EDIT 2: After @dusan.bajic suggestion, I added MasqueradeAddress 193.147.83.213
to the proftpd.conf
file.
Now FileZilla outputs this:
Estado: Connecting to 193.147.83.213:1980...
Estado: Connection established, waiting for welcoming message...
Error: Couldn't connect to server
I might say that I'm using FileZilla from my Windows machine like this:
Server: 193.147.83.213
User: sauron
Port: 1980
EDIT 2:
@dusan.bajic got a point. I disabled the firewall and this happended:
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
So it seems that it connected but when entering in passive mode
(by the way, what are the numbers in parentheses? Ports? )