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

无法使用wget和python http服务器下载现有文件,python,wget,simplehttpserver,Python,Wget,Simplehttpserver,因此,我安装了一个带有python-msimplehttpserver的http服务器,我得到: 在0.0.0.0端口8000上提供HTTP服务… 但是当我试着用 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 - - [0

因此,我安装了一个带有
python-msimplehttpserver的http服务器,我得到:

在0.0.0.0端口8000上提供HTTP服务…
但是当我试着用

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相对于其当前目录提供服务。尝试
wgethttp://localhost:8000/postgres_default_pass.txt


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

谢谢,这解决了我的问题,我会这样做。