繁体   English   中英

无法使用 wget 和 python http 服务器下载现有文件

[英]Unable to download an existing file with wget and python http server

所以我用python -m SimpleHTTPServer安装了一个 http 服务器,我得到:

Serving HTTP on 0.0.0.0 port 8000 ...但是当我尝试下载时

wget http://192.168.100.65:8000/tmp/postgres_default_pass.txt

我有:

    192.168.100.74 - - [09/Sep/2020 23:32:30] code 404, message File not found
192.168.100.74 - - [09/Sep/2020 23:32:30] "GET /tmp/postgres_default_pass.txt HTTP/1.1" 404 -

在 wget 机器中:

    Connecting to 192.168.100.65:8000... connected.
HTTP request sent, awaiting response... 404 File not found
2020-09-09 23:32:31 ERROR 404: File not found.

但是该文件存在,执行 ls 我可以找到该文件。

 ls
hsperfdata_kali
postgres_default_pass.txt
sqlmaprgl22hl623598

SimpleHTTPServer 相对于其当前目录提供服务。 试试wget http://localhost:8000/postgres_default_pass.txt

话虽如此,请注意,在 python3 中,它已作为 http.server 移入 http。 python2.7 正式不受支持,因此将任何系统转移到 python3 可能是个好主意。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM