How to fix «rsync: Failed to exec ssh: No such file or directory»?

I was getting following error while trying to copy one file to another server using rsync

1 2 3 4 5 6 7   [root@test ~]# rsync -avz -e ‘ssh -p 22’ text.tar.gz  [email protected]:/home/myuser/ rsync: Failed to exec ssh: No such file or directory (2) rsync error: error in IPC code (code 14) at pipe.c(84) [sender=3.0.9] rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: error in IPC code (code 14) at io.c(605) [sender=3.0.9]  

As you can see the error message is 

1 2 3   rsync: Failed to exec ssh: No such file or directory (2)  

This error means rsync is not able to locate the openssh client on the machine. 

How to fix “rsync: Failed to exec ssh: No such file or directory”? 

This can be fixed by installing the openssh client packages .  On a Centos machine , you can install it using yum , see the following example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29   ~]# yum install openssh-clients Loaded plugins: fastestmirror, ovl Loading mirror speeds from cached hostfile * base: mirror.cogentco.com * extras: mirror.vcu.edu * updates: centos.mbni.med.umich.edu Resolving Dependencies > Running transaction check -> Package opensshclients.x86_64 0:6.6.1p135.el7_3 will be installed > Processing Dependency: libedit.so.0()(64bit) for package: opensshclients6.6.1p135.el7_3.x86_64 > Running transaction check -> Package libedit.x86_64 0:3.012.20121213cvs.el7 will be installed > Finished Dependency Resolution   Dependencies Resolved   =================================================================================================================================================================================== Package Arch Version Repository Size =================================================================================================================================================================================== Installing: opensshclients x86_64 6.6.1p135.el7_3 updates 642 k Installing for dependencies: libedit x86_64 3.012.20121213cvs.el7 base 92 k   Transaction Summary =================================================================================================================================================================================== Install 1 Package (+1 Dependent package)  

After this rsync was working properly.

Author: , 0000-00-00