如何使用 FTP 代理设置 curl / wget?

如何使用 FTP 代理设置 curl / wget?

我在使用 curl 或 wget 通过 FTP 代理从 FTP 服务器下载文件时遇到了很多麻烦。我已设置 GUI FTP 程序来运行...

FTP使用以下设置:

在此处输入图片描述

当我仅使用 curl/wget 并将 ftp_proxy 变量设置为代理主机名时,我得到如下输出:

# curl -v ftp://ftp.astron.com/pub/file/file-5.05.tar.gz
* About to connect() to proxy blah port 21 (#0)
*   Trying blah... connected
* Connected to blah (blah) port 21 (#0)
> GET ftp://ftp.astron.com/pub/file/file-5.05.tar.gz HTTP/1.1
> User-Agent: curl/7.19.0 (x86_64-suse-linux-gnu) libcurl/7.19.0 OpenSSL/0.9.8h zlib/1.2.3 libidn/1.10
> Host: ftp.astron.com:21
> Pragma: no-cache
> Accept: */*
> Proxy-Connection: Keep-Alive
>
220-
220-Enter an Internet ftp address at the Name prompt.
220 Type help for usage information.
500 Syntax error, command unrecognized.
500 Syntax error, command unrecognized.
500 Syntax error, command unrecognized.

有没有什么方法可以配置 shell 环境和/或 curl/wget,并使用与 gFTP 相同的设置来通过 FTP 代理?

答案1

这里的问题似乎是所使用的代理类型。

您使用的代理是 FTP 代理。Wget 和 Curl 都使用 HTTP 代理。

相关内容