带有用户名和密码的 HTTPS 的正确 wget 命令语法是什么?

编程入门 行业动态 更新时间:2024-10-21 06:24:16
本文介绍了带有用户名和密码的 HTTPS 的正确 wget 命令语法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-04-26 04:05:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1128986.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:语法   用户名   命令   正确   密码

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!