scp的用法

linux之间传输文件或目录可以使用scp命令

1.将10.200.8.88服务器上的/home/build/AUTO/backup.sh文件拷贝到当前目录下

-bash-3.2# scp root@10.200.8.88:/home/build/AUTO/backup.sh .
The authenticity of host '10.200.8.88 (10.200.8.88)' can't be established.
RSA key fingerprint is 3c:00:31:32:0c:7e:c8:d0:44:0d:c3:16:7a:a3:1c:fd.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.200.8.88' (RSA) to the list of known hosts.
root@10.200.8.88's password: 
backup.sh                                                                                                                             100%  291     0.3KB/s   00:00    
-bash-3.2# 
传输之前需要输入root用户的密码


2.将本地文件test.txt传输到10.200.8.88服务器上的/home/build/AUTO/目录下

-bash-3.2# scp test.txt root@10.200.8.88:/home/build/AUTO 
root@10.200.8.88's password: 
test.txt                                                                                  100%   22     0.0KB/s   00:00    
-bash-3.2# 
传输之前需要输入root用户的密码

3.将10.200.8.88服务器上的/home/build/AUTO/conf/目录拷贝到当前目录下

-bash-3.2# scp -r root@10.200.8.88:/home/build/AUTO/conf/ .
root@10.200.8.88's password: 
hsm-2.5R4P1                                                                                                100%  440     0.4KB/s   00:00    
hsm-2.5R4_VPN                                                                                              100%  450     0.4KB/s   00:00    
hsm-2.5R4P2                                                                                                100%  440     0.4KB/s   00:00    
hsm-2.5R1P1                                                                                                100%  431     0.4KB/s   00:00    
hsm-2.5R1                                                                                                  100%  461     0.5KB/s   00:00  
传输之前需要输入root用户的密码

4.将本地目录hsmprogram传输到10.200.8.88服务器上的/home/build/AUTO/目录下

-bash-3.2# scp -r hsmprogram/ root@10.200.8.88:/home/build/AUTO
root@10.200.8.88's password: 
ca.cer                                                                                                     100% 1372     1.3KB/s   00:00    
hsm.pem                                                                                                    100% 3021     3.0KB/s   00:00    
monitor_status                                                                                             100%   20     0.0KB/s   00:00    
v3.sql                                                                                                     100% 6041     5.9KB/s   00:00    
v60.sql                                                                                                    100%  858     0.8KB/s   00:00    
v44.sql                                                                                                    100% 4498     4.4KB/s   00:00    
v50.sql                                                                                                    100% 1782     1.7KB/s   00:00    
v78.sql                                                                                                    100%   36KB  36.4KB/s   00:00    
v34.sql                                                                                                    100%  182     0.2KB/s   00:00    
v69.sql                                                                                                    100%   27KB  27.1KB/s   00:00    
v23.sql                                                                                                    100%   29     0.0KB/s   00:00    
v35.sql                                                                                                    100% 1366     1.3KB/s   00:00    
v6.sql                                                                                                     100% 1150     1.1KB/s   00:00    
v38.sql                                                                                                    100% 3569     3.5KB/s   00:00    
传输之前需要输入root用户的密码

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值