Rsync pull - Host key verification failed

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Rsync pull - Host key verification failed

      I have set up an Rsync job to backup my Nextcloud data folder (NC running on a Raspberry Pi on my local network) to my OMV server. So far I did the following:
      - As the Nextcloud data folder is owned by www-data, I created a user "NCrsync" on the Pi and added it to the www-data group
      - In the OMV GUI, I created a new SSH key and tried to copy the public key to the Pi which failed as the GUI can't handle the "Trust this RSA key" prompt. So I created the file /home/NCrsync/.ssh/authorized_keys on the Pi, copied the public key from the OMV GUI and pasted it into this file
      - Set up an Rsync job in the OMV gui with the following settings:

      Source Code

      1. Type: Remote
      2. Mode: Pull
      3. Source server: NCrsync@<pi-ip>:/media/hdd1/data
      4. Destination folder: shared folder on my OMV server
      5. Authentication: Public key
      6. SSH port: 22
      7. SSH certificate: nc-rsync

      However, if I start the Rsync job, it fails:

      Please wait, syncing <NCrsync@<pi-ip>:/media/hdd1/data> to <path-on-server> ...


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


      The synchronisation has completed successfully.
      Done ...

      What could be the reason for this to fail?

      Thank you very much in advance!
    • Well, something went wrong with the key exchange.
      The easiest way I know is to simply use
      ssh-copy-id NCrsync@<pi-ip>
      This will allow to connect to your pi without getting asked for the password, until keys change.
      If it is only about key verification just log in via ssh once and accept the key so it gets written into know_hosts.
      Also you should use lower case user names only, upercase may cause unexpected behaviour.