Rsync SSH Issues

cooter

Dabbler
Joined
Feb 28, 2016
Messages
29
I have been trying to setup rsync setup to backup my TrueNAS (billnas or 192.168.0.10) box to a Synology NAS (billnas2 or 192.168.0.12). I followed this guide: https://blog.filegarden.net/2021/02/24/backup-truenas-to-synology-via-rsync/

I am getting an error when I run the Rsync task:

No ED25519 host key is known for billnas2.XXXXXX.com and you have requested strict checking. Host key verification failed. rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(228) [sender=3.2.5]

This error started after I messed with the known_hosts file on the Truenas box. I removed the lines in the known hosts file, then I even tried to delete the file, hoping it would recreate itself (which it did not). The error I receieved before I messed with the known_hosts file was:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the ECDSA key sent by the remote host is SHA256:+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. Please contact your system administrator. Add correct host key in /mnt/Datastore_1/home/rsync/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /mnt/Datastore_1/home/rsync/.ssh/known_hosts:2 Host key for 192.168.0.12 has changed and you have requested strict checking. Host key verification failed. rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(228) [sender=3.2.5]

I am able to SSH from the truenas box to the synology box manually, but when I try to do it from the rsync task it fails. I am using rsync as the user in both cases. Example:

root@billnas:/mnt/Datastore_1/home/rsync/.ssh # ssh rsync@billnas2.XXXXX.com rsync@billnas2.XXXX.com's password: Synology strongly advises you not to run commands as the root user, who has the highest privileges on the system. Doing so may cause major damages to the system. Please note that if you choose to proceed, all consequences are at your own risk. rsync@billnas2:~$

That works just fine (also works if I use IP instead of domain name).

but this does not:

1671216348056.png

Thoughts on how to resolve this?
 

cooter

Dabbler
Joined
Feb 28, 2016
Messages
29
Okay, I think i may have figured this out....when I was first connecting to the synology through ssh from the Truenas box, I was logged in as root. I then assumed that running the ssh command when puttyed in as root then specifying the login for ssh it would update the known_hosts file. I was wrong...

I logged into Truenas as my rsync user, then connected via ssh to the synology and it seems to be working. and it updated the known_hosts file.
 
Top