Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rsync Host key verification failed

Tags:

ssh

rsync

I need help on this. I'm trying to execute this line from the command line and getting this error about host key. my mount point is there and I verify the hosts key is there as well any help on this will much appreciated.

su oracle -c '/usr/bin/rsync -zarR --delete --exclude "lost+found" --links --rsh="ssh -i /home/oracle/.ssh/rsync_lowZone_priv" hostname:/u02 /'

Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: unexplained error (code 255) at io.c(600) [receiver=3.0.6]

Thank you

like image 882
pirulo Avatar asked Feb 28 '15 16:02

pirulo


3 Answers

Try to connect first simply using ssh only, then post adding it to known hosts try sshpass, etc. as required.

In my case, I had done a clean new install of linux distro and installed sshpass and it started giving errors, they all went away as soon as I connected first via ssh and added the remote server's IP in the known hosts.

like image 84
Anshu Kumar Gupta Avatar answered Sep 22 '22 23:09

Anshu Kumar Gupta


I solved same problem with this command:

rsync --rsh="/usr/bin/sshpass -p "password" ssh -o StrictHostKeyChecking=no -l root" /source/file/path [email protected]:/destination/file/path

Note: Be sure about each side has sshpass installation before usage.

like image 43
Mustafa Kemal Avatar answered Sep 19 '22 23:09

Mustafa Kemal


In my case I was able to just 'ssh user@host' first and it offered to auto-generate the key for me which was then saved for subsequent sessions.

like image 42
Andrei Pokrovsky Avatar answered Sep 22 '22 23:09

Andrei Pokrovsky