wget 和 htaccess:仅限用户名

发布于 2024-12-27 02:43:45 字数 290 浏览 3 评论 0原文

我用谷歌搜索了如何使用 ubuntu 中的终端和 wget 下载图像。我找到了我需要的内容,但在受 .htaccess 保护的服务器上,没有密码。使用

wget admin@http://server.com/filename.jpg

它返回:没有到主机的路由。当我设置密码并输入

wget admin:password@http://server.com/filename.jpg

时,一切都很好。但是我不允许在服务器上使用密码。怎么解决,求路线?

I googled how to download images using terminal in ubuntu with wget. I found what I needed, but on the server, protected with .htaccess, there's no password. with

wget admin@http://server.com/filename.jpg

it returns: No route to hosts. When I set a password and type

wget admin:password@http://server.com/filename.jpg

everything's fine. However I am not allowed to use a password on the server. How to fix it, finding route?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓝戈者 2025-01-03 02:43:45

更容易:

wget --user="username" --password="password" http://xxxx.yy/filename.xxx

Much easier:

wget --user="username" --password="password" http://xxxx.yy/filename.xxx
一曲琵琶半遮面シ 2025-01-03 02:43:45

尝试

wget --user=admin http://server.com/filename.jpg

一下。

或者,

wget http://admin:@server.com/filename.jpg

也可以改为工作。

您的语法实际上是错误的,因为它:

wget http://user:pass@host/file

您的用户名位于网址之外,并且被视为主机名。

Try

wget --user=admin http://server.com/filename.jpg

instead.

Alternatively,

wget http://admin:@server.com/filename.jpg

may work instead.

Your syntax is actually wrong, as its:

wget http://user:pass@host/file

your username is outside the url, and was being treated as a hostname.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文