Linux – sshpass failed to run command: no such file or directory

centoslinuxssh

I am trying to use sshpass to copy a file between VMs. However when I run the command:

sshpass -p 'password' rsync --rsync-path="sudo rsync" "/home/myuser/anaconda/Anaconda2-4.3.0-Linux-x86_64.sh" "user2@destination.vm":/opt

I get the output: sshpass: Failed to run command: No such file or directory

I can ssh to destination.vm using user2 and its password.

I know sshpass is installed at /usr/bin/sshpass and is on the path.

I double checked the folders I want to copy from and to exist. I have also successfully set up passwordless sudo by editing the sudoers file.

I’m at a bit of a loss on what else to do to troubleshoot. Do you have any suggestions? Is there something else I need to do to be able to run sshpass?

EDIT:

Thank you for the responses! I have installed rsync on destination.vm as suggested and tested it with the command:

rsync -v -e ssh test.txt localhost:~

However, I am still seeing the same message when I try to use sshpass. I have successfully used this command on a different system, but I'm not sure what is different about this one that prevents the command from working.

Best Answer

Install rsync on destination.vm