12

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

idriss
  • 105
  • 1
  • 5
pirulo
  • 335
  • 1
  • 5
  • 13

7 Answers7

6

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.

Andrei Pokrovsky
  • 3,590
  • 3
  • 26
  • 17
5

I solved same problem with this command:

rsync --rsh="/usr/bin/sshpass -p "password" ssh -o StrictHostKeyChecking=no -l root" /source/file/path username@192.168.1.1:/destination/file/path

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

idriss
  • 105
  • 1
  • 5
Mustafa Kemal
  • 1,292
  • 19
  • 24
4

Host Key Verification Failed

This post does good job explaining the issue. In short:

The host key for domain.com has changed. If this does not seem fishy to you, you can remove the old key from your local cache using

ssh-keygen -R domain.com

Community
  • 1
  • 1
rexlibris
  • 41
  • 2
2

first to

$ ssh user@server -p port

you need to answer to typ yes; then

sshpass -p<my_password> rsync -avzh $VOLUME_PATH/*.chk user@server:${TARGET_PATH}

this will be worked

feng hong
  • 21
  • 3
1

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.

0

I have just hit this same issue now when trying to rsync data between 2 servers:

$ sshpass -p<my_password> rsync -avzh $VOLUME_PATH/*.chk user@server:${TARGET_PATH}
Host key verification failed.
rsync error: unexplained error (code 255) at rsync.c(638) [sender=3.1.1]

The error was misleading though - to fix the issue I had to install rsync on the target server as well. I am not sure why this is required but once both the source and target servers had rsync installed the copy went through.

dev-rowbot
  • 448
  • 4
  • 13
0

I had same problem, the reason was I was using IP address which was set in Cloud Flare CDN, and CF masks IPs. I used domain name instead and problem resolved.

AVEbrahimi
  • 17,993
  • 23
  • 107
  • 210