问题描述
限时送ChatGPT账号..我想使用 wget 通过此 URL 远程下载文件:
I would like to download a file remotely with this URL using wget:
https://test.mydomain/files/myfile.zip
站点 test.mydomain 需要登录.我想使用此命令在我的另一台服务器中下载该文件,但它不起作用(未完全下载文件):
The site test.mydomain requires a login. I would like to download that file in my another server using this command but it does not work (does not completely download the file):
wget --user=myusername --password=mypassword https://test.mydomain/files/myfile.zip
如果我的用户名是 myusername,密码是 mypassword,那么正确的 wget 语法是什么?
If my username is myusername and password is mypassword what would be the correct wget syntax?
以下是我输入上述命令后的返回信息:
The following are the return messages after I type the above command:
Resolving test.mydomain (test.mydomain)... 123.456.789
Connecting to test.mydomain (test.mydomain)|123.456.789|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://test.mydomain/login/unauthorized [following]
--2013-01-30 02:01:32-- https://test.mydomain/login/unauthorized
Reusing existing connection to test.mydomain:443.
HTTP request sent, awaiting response... 302 Found
Location: https://test.mydomain/login [following]
--2013-01-30 02:01:32-- https://test.mydomain/login
Reusing existing connection to test.mydomain:443.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `myfile.zip'
我错过了什么吗?请帮忙.谢谢.
Am I missing something? Please help. Thanks.
推荐答案
通过指定选项 --user 和 --ask-password wget 将要求提供凭据.下面是一个例子.根据您的需要更改用户名和下载链接.
By specifying the option --user and --ask-password wget will ask for the credentials. Below is an example. Change the username and download link to your needs.
wget --user=username --ask-password https://xyz/changelog-6.40.txt
这篇关于带有用户名和密码的 HTTPS 的正确 wget 命令语法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论