Minggu, 23 September 2018

How to install scp ssh client on redhat 6 minimal installation

  Tidak ada komentar
Some day i get an issue, i cannot find scp command on my redhat machine with minimal installation, after check the trouble is there is no ssh client installed on redhat 6 machine with minimal installation, here i share what i do to install ssh client on my redhat machine

[[email protected] ~]# scp /root/dbdump.db [email protected]:/root/
-bash: scp: command not found
[[email protected] ~]#
We have install the centos package repo first you can find how to install the centos package here, because the open ssh client are served by centos repo except your redhat subscribed to redhat repository
[[email protected] yum.repos.d]# yum list openssh-clients
Loaded plugins: product-id
Installed Packages
openssh-clients.x86_64                  5.3p1-123.el6_9                  @centos
[[email protected] yum.repos.d]#
[[email protected] yum.repos.d]#
Install the open-ssh client with enable centos repo as shown on following figure
[[email protected] yum.repos.d]#
[[email protected] yum.repos.d]# yum --enablerepo=centos install openssh-clients
Loaded plugins: product-id
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package openssh-clients.x86_64 0:5.3p1-123.el6_9 will be installed
--> Processing Dependency: openssh = 5.3p1-123.el6_9 for package: openssh-clients-5.3p1-123.el6_9.x86_64
--> Processing Dependency: libedit.so.0()(64bit) for package: openssh-clients-5.3p1-123.el6_9.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-104.el6 will be updated
--> Processing Dependency: openssh = 5.3p1-104.el6 for package: openssh-server-5.3p1-104.el6.x86_64
---> Package openssh.x86_64 0:5.3p1-123.el6_9 will be an update
--> Running transaction check
---> Package openssh-server.x86_64 0:5.3p1-104.el6 will be updated
---> Package openssh-server.x86_64 0:5.3p1-123.el6_9 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

 Package             Arch       Version                        Repository  Size
 openssh-clients     x86_64     5.3p1-123.el6_9                centos     444 k
Installing for dependencies:
 libedit             x86_64     2.11-4.20080712cvs.1.el6       centos      74 k
Updating for dependencies:
 openssh             x86_64     5.3p1-123.el6_9                centos     277 k
 openssh-server      x86_64     5.3p1-123.el6_9                centos     329 k

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

Total download size: 1.1 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): libedit-2.11-4.20080712cvs.1.el6.x86_64.rpm       |  74 kB     00:00
(2/4): openssh-5.3p1-123.el6_9.x86_64.rpm                | 277 kB     00:00
(3/4): openssh-clients-5.3p1-123.el6_9.x86_64.rpm        | 444 kB     00:00
(4/4): openssh-server-5.3p1-123.el6_9.x86_64.rpm         | 329 kB     00:00
Total                                           1.7 MB/s | 1.1 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : openssh-5.3p1-123.el6_9.x86_64                               1/6
  Installing : libedit-2.11-4.20080712cvs.1.el6.x86_64                      2/6
  Installing : openssh-clients-5.3p1-123.el6_9.x86_64                       3/6
  Updating   : openssh-server-5.3p1-123.el6_9.x86_64                        4/6
  Cleanup    : openssh-server-5.3p1-104.el6.x86_64                          5/6
  Cleanup    : openssh-5.3p1-104.el6.x86_64                                 6/6
  Verifying  : openssh-clients-5.3p1-123.el6_9.x86_64                       1/6
  Verifying  : libedit-2.11-4.20080712cvs.1.el6.x86_64                      2/6
  Verifying  : openssh-5.3p1-123.el6_9.x86_64                               3/6
  Verifying  : openssh-server-5.3p1-123.el6_9.x86_64                        4/6
  Verifying  : openssh-server-5.3p1-104.el6.x86_64                          5/6
  Verifying  : openssh-5.3p1-104.el6.x86_64                                 6/6

  openssh-clients.x86_64 0:5.3p1-123.el6_9

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

Dependency Updated:
  openssh.x86_64 0:5.3p1-123.el6_9    openssh-server.x86_64 0:5.3p1-123.el6_9

[[email protected] yum.repos.d]#
The ssh client successfully installed

How have to install ssh-client on both of server, instead you will get following error

[[email protected] yum.repos.d]# scp /root/dbdump.db [email protected]:/root/
The authenticity of host ' (' can't be established.
RSA key fingerprint is 48:fc:6a:4d:cf:30:90:76:85:6d:94:03:59:74:1f:6e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (RSA) to the list of known hosts.
[email protected]'s password:
bash: scp: command not found
lost connection
[[email protected] yum.repos.d]#
After we install ssh-client on both side, we can perform scp successfully

[[email protected] yum.repos.d]# yum list openssh-clients
Loaded plugins: product-id
Installed Packages
openssh-clients.x86_64                  5.3p1-123.el6_9                  @centos
[[email protected] yum.repos.d]#
[[email protected] yum.repos.d]#

Tidak ada komentar :

Posting Komentar