SCP命令小例子

本文展示了一个通过scp命令从远程服务器pg200拷贝文件到本地机的过程,并验证了文件内容的一致性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

远端机上文件:

复制代码
[root@pg200 ~]# pwd
/root
[root@pg200 ~]# ls -l gao.txt
-rw-r--r-- 1 root root 40 Sep 30 15:04 gao.txt
[root@pg200 ~]# cat gao.txt
A test from gao
Just do it to your best
[root@pg200 ~]# 
复制代码

 

在本地机上执行远程拷贝:

复制代码
[root@pg200 ~]# scp root@10.10.10.2:/root/gao.txt jian.txt 
The authenticity of host '10.10.10.2 (10.10.10.2)' can't be established.
RSA key fingerprint is 8a:e2:d0:df:84:9e:94:bc:8c:29:9d:f2:94:0b:93:46.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added '10.10.10.2' (RSA) to the list of known hosts.
root@10.10.10.2's password: 
gao.txt                                                                                                   100%   40     0.0KB/s   00:00    
[root@pg200 ~]# cat jian.txt
A test from gao
Just do it to your best
[root@pg200 ~]# 
复制代码






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值