有时候想在同一网段的服务器上传输文件,但是为了安全有不想做密匙认证,这时候可以用python的简单http来进行文件传输,去要被传输的文件或者目录下面执行下面的命令,如下:
[root@centos3 ~]# python -m SimpleHTTPServer 8081
Serving HTTP on 0.0.0.0 port 8081 ...
192.168.220.133 - - [15/Sep/2017 19:31:48] code 404, message File not found
192.168.220.133 - - [15/Sep/2017 19:31:48] "GET /apache-maven-3.5.0-bin.zip. HTTP/1.1" 404 -
192.168.220.133 - - [15/Sep/2017 19:31:51] "GET /apache-maven-3.5.0-bin.zip HTTP/1.1" 200 -
去另外一台下载:
root@ubuntu:~# wget http://192.168.220.132:8081/epel-release-6-8.noarch.rpm
--2017-09-15 11:35:47-- http://192.168.220.132:8081/epel-release-6-8.noarch.rpm
正在连接 192.168.220.132:8081... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 14540 (14K) [application/x-rpm]
正在保存至: “epel-release-6-8.noarch.rpm”
100%[========================================================================================================================================================
2017-09-15 11:35:47 (1.24 MB/s) - 已保存 “epel-release-6-8.noarch.rpm” [14540/14540])