- 参数
-P:指定端口,默认22可不写(P大写)
-r:递归拷贝目录
-p:属性不变
-l:限制速度 (如 -l 1024 默认单位M)
源主机:192.168.10.158
源文件:/root/software/apache-tomcat-8.5.32.tar.gz
目的主机:192.168.10.178
目的位置:/tmp/
- 推送实例
在源主机进行推送
[root@fudanwuxi ~]# cd /root/
[root@fudanwuxi ~]# ll software/
total 190660
-rw-r--r--. 1 root root 9584807 Aug 20 13:40 apache-tomcat-8.5.32.tar.gz
-rw-r--r--. 1 root root 185646832 Aug 20 13:33 jdk-8u181-linux-x64.tar.gz
[root@fudanwuxi ~]# scp -P22 -pr /root/software/apache-tomcat-8.5.32.tar.gz root@192.168.10.178:/tmp
The authenticity of host '192.168.10.178 (192.168.10.178)' can't be established.
ECDSA key fingerprint is SHA256:plDF/rfSdZkeOwQLGhV7M9NlvcQR78+4n1zWFE/Kw8E.
ECDSA key fingerprint is MD5:c1:79:b6:7e:a3:bb:52:50:d4:47:59:46:8c:87:ad:ee.
Are