“bash: scp: command not found” despite it exists

Posted on Dec 9, 2015

If You receive the error something like, despite the scp exist:

1
2
3
4
nsc-book:~ nsc$ scp root@loginroot.com:/root/filename ~/filename
bash: scp: command not found
nsc-book:~ nsc$ which scp
/usr/bin/scp

It may look silly, but please check if the destination server has that package too ;)
I haven’t expected a CentOS server not having this simple package by default.

Anyway, on CentOS it’s in openssh-clients package, and may be installed with command:

1
yum install openssh-client

Of if it exists there too, please check the PATH variable on the remote system, if it shosw the correct ipaths. Also, You may check .bashrc on remote user if it tries to overwrite the PATH value.