How to Install scp Command on CentOS 6.2

In this post, i will guide you on how to install scp command on CentOS 6.2. SCP is a secure copy (remote file copy program) and can copies files between hosts on a network.

You will get the following error if you don’t have scp command on your server.

[root@centos6 ~]# scp
-bash: scp: command not found
-rw-r--r-- 1 root root 0 2001-01-14 14:00:00.000000000 +0800 newtestfile1
Simply type this command to install scp.

[root@centos6 ~]# yum install openssh-clients
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirrors.hostemo.com
* extras: mirrors.hostemo.com
* updates: mirrors.hostemo.com
CentOS6.2-Repository | 1.3 kB 00:00 ...
CentOS6.2-Repository/primary | 1.2 MB 00:00 ...
CentOS6.2-Repository 3042/3042
base | 3.7 kB 00:00
base/primary_db | 3.5 MB 00:33
extras | 3.5 kB 00:00
extras/primary_db | 5.4 kB 00:00
updates | 3.5 kB 00:00
updates/primary_db | 638 kB 00:05
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package openssh-clients.i686 0:5.3p1-70.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================
Package Arch Version Repository Size
============================================================================================
Installing:
openssh-clients i686 5.3p1-70.el6 CentOS6.2-Repository 361 k

Transaction Summary
============================================================================================
Install 1 Package(s)

Total download size: 361 k
Installed size: 1.0 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : openssh-clients-5.3p1-70.el6.i686 1/1

Installed:
openssh-clients.i686 0:5.3p1-70.el6

Complete!
-rw-r--r-- 1 root root 0 2001-01-14 14:00:00.000000000 +0800 newtestfile1
Start using scp command to transfer the file.

[root@centos6 ~]# scp
usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 ... [[user@]host2:]file2
-rw-r--r-- 1 root root 0 2001-01-14 14:00:00.000000000 +0800 newtestfile1