CentOS安装scp命令

在测试中需要在两台虚拟机之间传递文件,首先想到的是scp命令,结果提示:

-bash: scp: command not found

想当然用yum install scp命令安装,结果提示:

No package scp available.

后来发现scp这东西应该属于openssh-clients这个包,运行:

yum install openssh-clients -y (注:两台机器都需要安装)


[root@localhost local]# yum install openssh-clients -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.pubyun.com
 * extras: mirrors.skyshe.cn
 * updates: ftp.sjtu.edu.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package openssh-clients.x86_64 0:5.3p1-104.el6_6.1 will be installed
--> Processing Dependency: openssh = 5.3p1-104.el6_6.1 for package: openssh-clients-5.3p1-104.el6_6.1.x86_64
--> Processing Dependency: libedit.so.0()(64bit) for package: openssh-clients-5.3p1-104.el6_6.1.x86_64
--> Running transaction check
---> Package libedit.x86_64 0:2.11-4.20080712cvs.1.el6 will be installed
---> Package openssh.x86_64 0:5.3p1-94.el6 will be updated
--> Processing Dependency: openssh = 5.3p1-94.el6 for package: openssh-server-5.3p1-94.el6.x86_64
---> Package openssh.x86_64 0:5.3p1-104.el6_6.1 will be an update
--> Running transaction check
---> Package openssh-server.x86_64 0:5.3p1-94.el6 will be updated
---> Package openssh-server.x86_64 0:5.3p1-104.el6_6.1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================================================================
 Package                                                 Arch                                           Version                                                            Repository                                       Size
=================================================================================================================================================================================================================================
Installing:
 openssh-clients                                         x86_64                                         5.3p1-104.el6_6.1                                                  updates                                         437 k
Installing for dependencies:
 libedit                                                 x86_64                                         2.11-4.20080712cvs.1.el6                                           base                                             74 k
Updating for dependencies:
 openssh                                                 x86_64                                         5.3p1-104.el6_6.1                                                  updates                                         272 k
 openssh-server                                          x86_64                                         5.3p1-104.el6_6.1                                                  updates                                         321 k

Transaction Summary
=================================================================================================================================================================================================================================
Install       2 Package(s)
Upgrade       2 Package(s)

Total download size: 1.1 M
Downloading Packages:
(1/4): libedit-2.11-4.20080712cvs.1.el6.x86_64.rpm                                                                                                                                                        |  74 kB     00:00     
(2/4): openssh-5.3p1-104.el6_6.1.x86_64.rpm                                                                                                                                                               | 272 kB     00:00     
(3/4): openssh-clients-5.3p1-104.el6_6.1.x86_64.rpm                                                                                                                                                       | 437 kB     00:00     
(4/4): openssh-server-5.3p1-104.el6_6.1.x86_64.rpm                                                                                                                                                        | 321 kB     00:00     
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                            1.3 MB/s | 1.1 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : openssh-5.3p1-104.el6_6.1.x86_64                                                                                                                                                                              1/6 
  Installing : libedit-2.11-4.20080712cvs.1.el6.x86_64                                                                                                                                                                       2/6 
  Installing : openssh-clients-5.3p1-104.el6_6.1.x86_64                                                                                                                                                                      3/6 
  Updating   : openssh-server-5.3p1-104.el6_6.1.x86_64                                                                                                                                                                       4/6 
  Cleanup    : openssh-server-5.3p1-94.el6.x86_64                                                                                                                                                                            5/6 
  Cleanup    : openssh-5.3p1-94.el6.x86_64                                                                                                                                                                                   6/6 
  Verifying  : libedit-2.11-4.20080712cvs.1.el6.x86_64                                                                                                                                                                       1/6 
  Verifying  : openssh-server-5.3p1-104.el6_6.1.x86_64                                                                                                                                                                       2/6 
  Verifying  : openssh-5.3p1-104.el6_6.1.x86_64                                                                                                                                                                              3/6 
  Verifying  : openssh-clients-5.3p1-104.el6_6.1.x86_64                                                                                                                                                                      4/6 
  Verifying  : openssh-5.3p1-94.el6.x86_64                                                                                                                                                                                   5/6 
  Verifying  : openssh-server-5.3p1-94.el6.x86_64                                                                                                                                                                            6/6 

Installed:
  openssh-clients.x86_64 0:5.3p1-104.el6_6.1                                                                                                                                                                                     

Dependency Installed:
  libedit.x86_64 0:2.11-4.20080712cvs.1.el6                                                                                                                                                                                      

Dependency Updated:
  openssh.x86_64 0:5.3p1-104.el6_6.1                                                                          openssh-server.x86_64 0:5.3p1-104.el6_6.1                                                                         

Complete!
[root@localhost local]# 

再运行scp就可以了,再次运行:


[root@localhost local]# scp mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz  root@192.168.1.206:/usr/local/
root@192.168.1.206's password: 
mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz                                                                                                                                                      100%  292MB  18.3MB/s   00:16    
[root@localhost local]# 



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值