FTP backup fails everytime

DigitalDev

Verified User
Joined
Jul 20, 2022
Messages
90
Hi Community,
Juist wondered if anyone else has run into problems with admin bacjups over FTP.

Im on the page /admin/backups/1/modify/where and trying to get it to save with FTP credentials but no matter what FTP details i use DA will say the connection is refused even though on my FTP server i watched DA login correctly.

<Date> Info [Type] Message
<04/12/2022 22:10:12> FTP Session 6 34.68.136.98 [Command] USER autobak
<04/12/2022 22:10:12> FTP Session 6 34.68.136.98 [Response] 331 Please, specify the password.
<04/12/2022 22:10:12> FTP Session 6 34.68.136.98 [Command] PASS ****
<04/12/2022 22:10:12> FTP Session 6 34.68.136.98 autobak [Response] 230 Login successful.
<04/12/2022 22:10:12> FTP Session 6 34.68.136.98 autobak [Command] PWD
<04/12/2022 22:10:12> FTP Session 6 34.68.136.98 autobak [Response] 257 "/" is current directory.
<04/12/2022 22:10:12> FTP Session 6 34.68.136.98 autobak [Command] CWD /
<04/12/2022 22:10:12> FTP Session 6 34.68.136.98 autobak [Response] 250 CWD command successful
<04/12/2022 22:10:12> FTP Session 6 34.68.136.98 autobak [Command] EPSV
<04/12/2022 22:10:12> FTP Session 6 34.68.136.98 autobak [Response] 229 Entering Extended Passive Mode (|||56773|)
<04/12/2022 22:10:14> FTP Session 6 34.68.136.98 autobak [Command] PASV
<04/12/2022 22:10:14> FTP Session 6 34.68.136.98 autobak [Response] 227 Entering Passive Mode (192,168,0,16,221,198)
<04/12/2022 22:10:15> FTP Server [Status] Session 6 ended gracefully.

This is the 3rd FTP server i have tried and DA will just not connect to any of them.....

The ERROR im getting in DA is,

/usr/bin/curl returned error code 7
curl: (7) Failed to connect to digitaldev.myftp.org port 21: Connection refused
FTP information invalid.
 
Seems you're trying to login to a server at home. Which is behind a firewall so PASV traffic is required. Which is also seen in the part of the log you posted.

You can either open all outgoing ports above 1024 (not advisable) on your DA server or set your backup FTP server to use passive ports 35000:35999 and then it should in fact start working. Provided you used the correct credentials.

Also be aware these ports must be opened on the backup server you are running this FTP server on. So create the correct portforwards for it and specify the port range in the ftp server program.
 
I have got it working but only by adding my home IP to the CSF, which is not great as my IP at home is dynamic.... I wouldnt have thought id need to allow my IP for DA outgoing connections....
 
No that is normally not needed.

However there is an easier way if you have to do this. Just register an ip with no-ip.org or a similar free service.
For example foo.no-ip.org which points to your home ip. Via your router this can be updated automatically on ip change.

In CSF use the /etc/csf/csf.dyndns file and add foo.no-ip.org in there, remove your ip from where you added it and then restart csf and lfd.

This way it should work automatically and you don't have to worry about the changing ip.

Better way ofcourse is to investigate what is causing the issue, of pasv ports are the same and correctly forwarded etc. so there is no need for adding your ip.
 
Thanks Richard, i am using no-ip so thank you for the CSF tips/tricks i will do that and add my no-ip host.

All my ports seem to match and are correct as you suggest so im just doing a little more investigating first, i hate a work around as you say id much rather find the issue..

One issue im currently looking into is the fact im using my mobile SIM card as my internet at the moment so it could be something related to 4G and my operator , so im just testing the diffirent between my home broadband NAT router and the 4G router.....
 
i hate a work around as you say id much rather find the issue..
Glad we think alike. Finding a cause always can definately take care of things. If all is set correctly, maybe trying with an ftp client from the linux box will work and then check logs to what happens, looking if the same problem occurs.
Probably with csf/lfd disabled on the DA server (you could test) curl might work too. If that is the case, we could be sure it must be a firewall issue, question is then which one.

Indeed maybe the 4G does not accept something which the home broadband would. I'm very curious to the solution if you find it.

Nothing just works "out the box" anymore lol
I'm guess I'm just lucky and don't experience this issue. I've been backupping some accounts to my home NAS until recently without issues.
 
Back
Top