Today I was working on setting up a MySQL backup/failover for our Identity Management servers and needed to install some additional MySQL Utilities to make it work.  I downloaded the files to my local computer and then tried to push them to the master and slave with scp.  But, I got the following:

bash: scp: command not found
lost connection

So I did a which scp and got the expected /usr/bin/scp, but still no luck when trying to copy the files over.  I spent a bit of time doing Google queries for scp not working on my local machine until I ran across a related post somewhere that dealt with PATH exports on the remote server.  Turns out, the problem was with the remote servers — though not PATH exports. The remote servers didn’t have scp installed, so the command couldn’t be found on the remote server, and that’s what caused the error message.

scp comes with the SSH package, so an install fixed my issue:

RedHat: yum install openssh-clients
Ubuntu: apt-get install ssh

Here’s hoping this helps someone save a bit of time.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.