我想下载 FTP 目录中列出的文件,ftp://ftp.ivc.polytech.univ-nantes.fr/NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/。在我的 WINDOWS 笔记本电脑上,当我将此链接放在文件资源管理器的地址栏中时,我可以查看和下载其内容,如下所示,
但我想通过 ssh 在远程 UBUNTU 服务器上下载这些文件,并尝试了以下操作,但出现了相应的错误消息,
wget -r ftp://ftp.ivc.polytech.univ-nantes.fr/NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/
和都wget -m ftp://ftp.ivc.polytech.univ-nantes.fr/NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/
出现以下错误
--2021-08-24 09:18:07-- ftp://ftp.ivc.polytech.univ-nantes.fr/NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/
=> ‘ftp.ivc.polytech.univ-nantes.fr/NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/.listing’
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.
使用更详细的错误报告wget -r -v -d ftp://ftp.ivc.polytech.univ-nantes.fr/NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/
会给出以下错误报告,
DEBUG output created by Wget 1.17.1 on linux-gnu.
Reading HSTS entries from /usr2/mohilamb/.wget-hsts
URI encoding = ‘UTF-8’
Using ‘ftp.ivc.polytech.univ-nantes.fr/NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/.listing’ as listing tmp file.
--2021-08-24 15:13:32-- ftp://ftp.ivc.polytech.univ-nantes.fr/NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/
=> ‘ftp.ivc.polytech.univ-nantes.fr/NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/.listing’
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://ftp.ivc.polytech.univ-nantes.fr/NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/
(try: 2) => ‘ftp.ivc.polytech.univ-nantes.fr/NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/.listing’
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.
- 我甚至尝试了 ftp 和 sftp,但它们也不起作用。
有趣的是,如果我在 Google Colab 上执行它,我可以下载 ftp 目录。但对于我的远程 Ubuntu 系统,我得到了上述错误。请注意,访问它不需要用户名或密码。
答案1
如果启用了 ssh,并且您知道路径,那么从任一主机执行操作都应该很简单。
SCP[电子邮件保护]:/ftp_root_folder/NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/。/主页/一些用户/目标文件夹/
如果 scp 不可用。
ftp
open ftp.ivc.polytech.univ-nantes.fr
cd /NAMA3DS1_COSPAD1/Avi_videos/HRC_00_Reference/
lcd ~/MyLocalPath/
pull *
我刚刚在你的主机上尝试了这个,它起作用了你可能需要使用 pasv 启用被动模式