Can't connect to FTP server: 425 Unable to build data connection: Connection timed out

15

1

I have a Windows 7 installed on my laptop. I installed VirtualBox 4.1.4 with Ubuntu 11.10.

I'm trying to connect to my site via FTP but I got an error when I do ls:

~> ftp <my_site>
Connected to <my_site>.
220 DreamHost FTP Server
Name (<my_site>:misha): <my_username>
331 Password required for <my_username>
Password: <my_password>
230 User <my_username> logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful
425 Unable to build data connection: Connection timed out
ftp> 

What could be the problem?

Misha Moroshko

Posted 2011-11-10T23:14:32.643

Reputation: 5 573

Answers

24

The connection is establishing but it is unable to set up the return data path.

This is likely because something in the path isn't supporting PORT mode ftp from the source (the perimeter router perhaps).

Try using ftp -p which will begin the client in passive (PASV) mode.

Paul

Posted 2011-11-10T23:14:32.643

Reputation: 52 173

I'm using newer versions of Ubuntu and Virtualbox, and the passive mode helped me as well, +1! – gustavohenke – 2016-07-20T14:42:31.400

2

As pointed out in a now-deleted answer by Damon Hill, “If you’re already connected to the ftp server and you forgot the -p argument, you can issue the command passive so as to enter this mode.”

– Scott – 2018-10-12T23:22:17.217

@Scott This is helpful enough to warrant editing the accepted answer. It is encouraged in fact. – Paul – 2018-10-12T23:35:23.157

Frankly, I thought it was useful enough that it should have been allowed to stand as a separate (supplementary) answer, but a moderator disagreed.   You’re ≥20K; you can see the deleted answer — can you undelete it?   Or can that only be done by a moderator at this point?  In any case, as long as you are aware of the issue, I’ll leave any further action (to include editing your answer) to you. – Scott – 2018-10-13T00:36:43.943

0

where is your server is it local ? if not,
in active FTP your you have issue with NAT translation as connection port is fixed port 21 but for data port may varies above 1024, due to NAT from pool FTP application is not able to establish DATA connection.

if you use windows ftp.exe it dosent support Passive FTP mode , so PASV command wont work. only ubuntu/unix OS support Passive FTP, here server will initiate data port , and will ask remote to connect via that port.

as your Service provider for /30 public ip issue will resolve.

Mr alone

Posted 2011-11-10T23:14:32.643

Reputation: 1