问题描述:
拷贝文件到目标主机报错点击(此处)折叠或打开
- scp /usr/bin/xxx root@10.90.244.15:/usr/bin/
-
root@10.90.244.15's password:
- bash: scp: command not found
发现问题:
1. 查询本地scp属于哪个rpm包点击(此处)折叠或打开
- [root@xxx ~]# rpm -qf /usr/bin/scp
- openssh-clients-5.3p1-81.el6.x86_64
点击(此处)折叠或打开
- [root@localhost yum.repos.d]# rpm -qa|grep openssh-clients
- [root@localhost yum.repos.d]#
解决问题:
搭建本地源安装oepnssh-client- 创建repo配置文件
点击(此处)折叠或打开
- [root@localhost yum.repos.d]# cat /etc/yum.repos.d/rhel.repo
- [rhel] #ID
- name=rhel-6.9 #repo name
- baseurl=file:///media #location
- enabled=1 #1 enable this repo 0 disable this repo
- gpgcheck=0 # 0 no gpg check 1 start gpg check
- 挂载安装镜像文件
点击(此处)折叠或打开
- [root@localhost yum.repos.d]# mount ~/rhel-server-6.9-x86_64-dvd.iso -o loop /media/
- 检查repo
点击(此处)折叠或打开
-
[root@localhost yum.repos.d]# yum repolist
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
rhel | 4.1 kB 00:00 ...
rhel/primary_db | 3.1 MB 00:00 ...
repo id repo name status
rhel rhel-6.9 3,854
repolist: 3,854
- 安装openssh-clients
点击(此处)折叠或打开
- [root@localhost yum.repos.d]# yum install -y openssh-clients
- Loaded plugins: product-id, search-disabled-repos, subscription-manager
- This system is not registered with an entitlement server. You can use subscription-manager to register.
- Setting up Install Process
- Resolving Dependencies
- --> Running transaction check
- ---> Package openssh-clients.x86_64 0:5.3p1-122.el6 will be installed
- --> Processing Dependency: libedit.so.0()(64bit) for package: openssh-clients-5.3p1-122.el6.x86_64
- --> Running transaction check
- ---> Package libedit.x86_64 0:2.11-4.20080712cvs.1.el6 will be installed
- --> Finished Dependency Resolution
- Dependencies Resolved
- ================================================================================
- Package Arch Version Repository
- Size
- ================================================================================
- Installing:
- openssh-clients x86_64 5.3p1-122.el6 rhel 443 k
- Installing for dependencies:
- libedit x86_64 2.11-4.20080712cvs.1.el6 rhel 74 k
- Transaction Summary
- ================================================================================
- Install 2 Package(s)
- Total download size: 518 k
- Installed size: 1.5 M
- Downloading Packages:
- --------------------------------------------------------------------------------
- Total 21 MB/s | 518 kB 00:00
- Running rpm_check_debug
- Running Transaction Test
- Transaction Test Succeeded
- Running Transaction
- Installing : libedit-2.11-4.20080712cvs.1.el6.x86_64 1/2
- Installing : openssh-clients-5.3p1-122.el6.x86_64 2/2
- rhel/productid | 1.6 kB 00:00 ...
- Verifying : libedit-2.11-4.20080712cvs.1.el6.x86_64 1/2
- Verifying : openssh-clients-5.3p1-122.el6.x86_64 2/2
- Installed:
- openssh-clients.x86_64 0:5.3p1-122.el6
- Dependency Installed:
- libedit.x86_64 0:2.11-4.20080712cvs.1.el6
- Complete!
结果:
拷贝文件到远程主机点击(此处)折叠或打开
- [root@xxx ~]# scp /usr/bin/xxx root@10.90.244.15:/usr/bin/
- root@10.90.244.15's password:
- xxx 100% 5049 4.9KB/s 00:00