5

Getting "ftp error 425 failed to establish connection" when trying to connect to ftp server. Tried 2 ftp clients on 3 machines on same network and none work. However FTP works from home / mobile broadband.

  • No ip blocks on ftp sever.
  • Other ftp servers(differrent ip/hosts) work okay.
  • firewall setup correct, no ports blocked.

Is it possible to use a proxy for ftp a i think it's something with the ISP but taking too long to fix?

2
  • FTP and FTPS are quite different. Mostly same letters, same goal. Different architecture. It is a bit like tagging a question with [benzine/gas] and [diesel] and stating "I have a problem with my fuel". Could you narrow it down?
    – Hennes
    Sep 6, 2016 at 12:26
  • Also, I read 'when trying to connect' as on the initial connection attempt (e.g. when you might issue user, pass, capabilities etc etc). Not after connecting and issuing and get/put/ls or similar command. Is that correct?
    – Hennes
    Sep 6, 2016 at 12:27

4 Answers 4

3

on a vsftpd server within CentOS 7 there was an error 425 sometimes

ftp.exe from Windows Legacy (2000, XP, 7) support only active ftp (ports 21,20) ftp.exe from Windows 10 does work with passive mode. this vsftpd server was configured to support both active and passive modes it had both lines at /etc/vsftpd/vsftpd.conf:

connect_from_port_20=YES
pasv_enable=YES

but, Windows 10, and others, sometimes did login and were able to transfer, sometimes they did not, with error 425; this was not a NAT, router or firewall problem; as one can find searching the Internet, it was a security policy by SELinux.

the solution:

setsebool -P ftpd_connect_all_unreserved 1
1
  • This is the answer I needed. Jun 17, 2020 at 9:49
1

According to an answer on superuser, the problem is that something on the way from you to your ftp server only supports "passive" mode FTP connections. Adding -p to your ftp commandline swiches it to passive mode. Otherwise look up the relevant option in your ftp program.

1

Assuming the user/password dialog is successful and you are attempting the GET command, then you get the "Failed to Establish Connection" whiney message, perhaps it is the ftp port number. Sometimes ftp passive ports are range limited, such as using ports 5000-5999. This can be done within your or their router. Either get both ftp's using the same passive port range, or include the command "PASSIVE" within your ftp command dialog.

This passive port limit might be set in /etc/vsftpd/vsftpd.conf

pasv_min_port=5000
pasv_max_port=5999
pasv_enable=YES
1
  • upvoted as this seems good advice, using lsof i see a port in the range is fired up when i attempt to connect in passive mode. Still getting ftp: connect: Connection timed out, but that's probably for another question
    – bbarker
    Apr 4, 2019 at 15:47
1

ftp uses two type of connection 1st for FTP cammands and replies 2nd for data transnmission

first add rule to ufw to allow 21 port. $sudo service ufw allow 21

If it won't work then try to stop the ufw firewall that blocking your transmission. $sudo service ufw stop after this perform ftp task.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .