【问题标题】:Setting required to do wget from a linux http server从 linux http 服务器执行 wget 所需的设置
【发布时间】:2018-05-19 15:08:00
【问题描述】:

我想从 http 服务器获取一个文件,例如:

wget --no-check-certificate --http-user=<username> --http-passwd=<passwd> https://<file_path>

  1. 需要哪些初始 ssh 设置?
  2. 我在远程系统上的 know_hosts 中更新了什么?
  3. 是否需要重新启动?

【问题讨论】:

标签: linux wget


【解决方案1】:
1. What are the initial ssh setup required? 

您无需 ssh 设置即可使用 wget。如果你在linux上,它应该是内置的。您可以通过键入来确认:

$ type wget

如果您收到类似

的回复
wget is /usr/local/bin/wget

你可以走了。无需设置。

2. What do i update in the know_hosts on the remote system? 

没什么,那个文件是特定于 ssh 的。别管它。

3. Is a restart reuired?

不,即使您要安装 wget。

【讨论】:

    【解决方案2】:

    你需要做两件事:

    1. 在您的 Ubuntu 安装上安装 Apache。使用的命令是 sudo apt-get install apache2。
    2. 复制或移动您的file.conf 到/var/www 的文件夹。你可能 需要再次使用sudo:例如sudo cp /path/to/your/file.conf /var/www/file.conf。

    wget 可能不适用于通配符。一旦您的所有配置文件都可以访问,更好的解决方案是使用 shell 脚本执行类似的操作:

    #!/bin/bash
    
    for i in {1..100}
    
    do
    
    wget "127.0.$i.1"
    
    done
    

    另一种解决方案

    note wget 只有在另一端运行着 HTTP 服务器时才能下载任何内容。

    您也许可以通过 ssh 批量运行命令,这可能会有所帮助:

    # on the client machine:
    cd /home/username/Pictures/
    python -m SimpleHTTPServer
    

    这会在运行它的机器上启动一个网络服务器。然后,您可以使用

    从任何地方访问该文件
    wget http://172.29.34.15:8000/x.jpeg
    

    【讨论】:

    • 虽然我提供了正确的密码和用户名,但我收到错误“已发送 HTTP 请求,正在等待响应... 401 Unauthorized Authentication selected: Basic realm="Intranet ID and Password" 重用与 HTTP 请求已发送,等待响应... 401 Unauthorized Username/Password Authentication Failed."
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-24
    相关资源
    最近更新 更多