scp远程拷贝

发布于 29 天前  24 次阅读


作用: 主机和主机之间文件相互传输,每次都是全量的传输.基于SSH方式传输 默认使用的22端口

#推送
将web01上的/ect/passwd 推送到nfs的/root下
[root@web01 ~]# scp /etc/passwd root@172.16.1.31:/root/
The authenticity of host '172.16.1.31 (172.16.1.31)' can't be established.
ECDSA key fingerprint is SHA256:jmToEI850uw7id+vmhN5XjMaT4diMiv3QD/BX6MK4ds.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '172.16.1.31' (ECDSA) to the list of known hosts.

Authorized users only. All activities may be monitored and reported.
root@172.16.1.31's password: 
passwd  
[root@nfs ~]#ll
total 4
-rw-r--r-- 1 root root 1907 Dec  5 19:02 passwd

#拉取
将nfs的123.txt拉取到当前位置
[root@web01 ~]# scp  root@172.16.1.31:/root/123.txt  ./

Authorized users only. All activities may be monitored and reported.
root@172.16.1.31's password: 
123.txt                                                                                                        100%    0     0.0KB/s   00:00    
[root@web01 ~]#ll
total 4
-rw-r--r-- 1 root root   0 Dec  5 19:08 123.txt
小棱
最后更新于 2024-12-24