Thursday, November 7, 2013

SCP Not Available in CentOS 6? - SOLVED!

I was recently running WinSCP in order to transfer some files on an ext4-formatted external USB from CentOS to Windows. I got an error message in WinSCP:
Copying files from remote side failed.
Cannot execute SCP to start transfer. Please make sure that SCP is installed on the server and path to it is included in PATH. You may also try SFTP instead of SCP.
Command failed with return code 127.

On the CentOS server, I got the following output after running  "which scp"
# which scp
/usr/bin/which: no scp in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

Further investigation reveals that the "openssh-clients" package is the one that would provide scp functionality if installed:
# yum provides */scp
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base:
 * extras:
 * updates:
openssh-clients-5.3p1-84.1.el6.x86_64 : An open source SSH client applications
Repo        : base
Matched from:
Filename    : /usr/bin/scp

To fix the error, I installed the "openssh-clients" package:
# yum -y install openssh-clients

No more errors from WinSCP when copy files over from CentOS to Windows.

Courtesty of: