linux:用交互式ftp接受的用户名/密码,但用wget“登录不正确”


0

我正在尝试从ftp站点下载一些数据,但是登录时遇到了问题。我知道用户名/密码是正确的,因为它在交互式使用ftp时有效。但是,当我尝试使用wget时,我得到:

Logging in as $username...
Login incorrect.

我从命令行尝试了以下命令:

wget -r -nd -A "path/to/data/*/*hdf" --ftp-user=$username --ftp-password=$password ftp:$ftpSite

wget -r -nd -A "path/to/data/*/*hdf" --user=$username --password=$password ftp:$ftpSite

wget -r -nd -A "path/to/data/*/*hdf" --ftp-user=$username --ask-password ftp:$ftpSite

wget -r -nd -A "path/to/data/*/*hdf" --user=$username --ask-password ftp:$ftpSite

我总是得到相同的“登录不正确”失败。

我在不使用变量的情况下从命令行运行。我只在这个问题中使用变量来审查敏感信息。

我会在ftp中使用mget,但我的理解是我不能使用通配符从多个子目录中获取文件。当我尝试“mget * / * hdf”时,我得到一个“没有这样的文件或目录”错误。但是我知道数据存在,因为当我进入其中一个子目录并执行“mget * hdf”时,它可以工作

Answers:


0

用户名和密码设置 .netrc 优先于命令行选项 --user=*wget,因此它忽略命令行中给出的用户名。

请检查你的 ~/.netrc

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.