Download FTP directory and files in remote Ubuntu server via SSH

I want to download the files listed in a FTP directory, ftp://. On my WINDOWS laptop when I put this link in the address bar of file explorer, I am able to view and download its content as shown below,

enter image description here

But I want to download these files in a remote UBUNTU server via ssh and have tried the following with corresponding error message,

  1. Both wget -r ftp:// and wget -m ftp:// gives the following error
--2021-08-24 09:18:07-- ftp:// => ‘
Resolving ftp.ivc.polytech.univ-nantes.fr (ftp.ivc.polytech.univ-nantes.fr)... 193.52.82.2
Connecting to ftp.ivc.polytech.univ-nantes.fr (ftp.ivc.polytech.univ-nantes.fr)|193.52.82.2|:21... connected.
Logging in as anonymous ...
Error in server response, closing control connection.
Retrying.

A more detailed error report using wget -r -v -d ftp:// gives the following error report,

DEBUG output created by Wget 1.17.1 on linux-gnu.
Reading HSTS entries from /usr2/mohilamb/.wget-hsts
URI encoding = ‘UTF-8’
Using ‘ as listing tmp file.
--2021-08-24 15:13:32-- ftp:// => ‘
Resolving ftp.ivc.polytech.univ-nantes.fr (ftp.ivc.polytech.univ-nantes.fr)... 193.52.82.2
Caching ftp.ivc.polytech.univ-nantes.fr => 193.52.82.2
Connecting to ftp.ivc.polytech.univ-nantes.fr (ftp.ivc.polytech.univ-nantes.fr)|193.52.82.2|:21... connected.
Created socket 3.
Releasing 0x00005608710e8320 (new refcount 1).
220 FTP server ready
Logging in as anonymous ...
--> USER anonymous
Error in server response, closing control connection.
Closed fd 3
Retrying.
--2021-08-24 15:13:34-- ftp:// (try: 2) => ‘
Found ftp.ivc.polytech.univ-nantes.fr in host_name_addresses_map (0x5608710e8320)
Connecting to ftp.ivc.polytech.univ-nantes.fr (ftp.ivc.polytech.univ-nantes.fr)|193.52.82.2|:21... connected.
Created socket 3.
Releasing 0x00005608710e8320 (new refcount 1).
220 FTP server ready
Logging in as anonymous ...
--> USER anonymous
Error in server response, closing control connection.
Closed fd 3
Retrying.
  1. I even tried ftp and sftp and they also do not work.

Interestingly if I execute it on Google Colab I am able to download the ftp directory. But for my remote Ubuntu system I get the above-mentioned errors. Note that one does not require username or password to access it.

1

1 Answer

If ssh is enabled, and you know the path then it should be simple to do from either of the hosts.

scp :/ftp_root_folder/NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/. /home/someUser/DestinationFolder/

If scp is not available.

ftp
open ftp.ivc.polytech.univ-nantes.fr
cd /NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/
lcd ~/MyLocalPath/
pull *

I just tried this on your host, and it worked You might need to enable passive mode with pasv

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like