Host key for server changed?

I set up a Replication Task to copy snapshots from one TN server to another (both on the same network).
It worked correctly for about 4 or 5 days.
This morning I have an error;

Host key for server 'my.server.com' does not match:
got 'keyXX',
expected 'keyYY'.

I haven’t changed or updated any info on the user accounts for the servers so I don’t know why this happened.
Appreciate any help.

Check your keys. Setting or changing keys could impact the contents of your .ssh directory. It is reporting a key mismatch, so something happened. I have had replication running on TN Scale 24.x.x for 6 months without issue.

I agree something happened, I just don’t know what.
I tried to create a new ssh connection, and now I get a generic ‘connection refused’ error.
I can ssh in from the console of the server I’m trying to replicate from, but not from the replication task.
Not sure where to begin troubleshooting.

Look in the .ssh directory on both sides, check the known_host and authorized_keys for matches, or try to set up a new replication task,

I deleted all SSH connections saved on the source that can’t connect and then deleted the replication. Tried to create a new one and got the same ‘connection refused’ error.

That would be /etc/.ssh? Where are the known_host and authorized_keys, are they files or directories? Is it safe to delete the files or their contents?

I appreciate the info, but I’m just not sure what to do with the info.

The other thing that’s odd is that if I open up a shell in the TN GUI I can ssh into the other machine just fine, it’s only rejecting me from the replication task creation wizard.

The files will be in the ssh users home directory in a subdirectory called .ssh. If you are getting connection refused, the answering host likely has SSH turned off or on a different port than 22.

I created a brand new user with the same results, also, as I said. I can log in from the target to the destination via ssh in a shell so there’s got to be something about the replication task that’s causing the denial.
The destination host has ssh running on port 22.

Can you do a key based ssh from the shell on the source system to the target system? If you are getting connection refused, it is unlikely to be the replication task.

I’m not exactly sure how to do that.
I looked up a few tutorials online but none of them worked out.
Can I get some suggestions on how to move the key correctly?

This is a pretty good tutorial. HERE

I followed the article here : Adding SSH Credentials | TrueNAS Documentation Hub
Then I tried to log in and got this:

Permission denied (publickey).

This is the user I’m trying to log into:


It didn’t ask for a password, so I assume it knows keys are available, before I pasted the public key it asked for one.

I just created another ssh connection from destination to target, and it worked without a hitch.
I looked over my firewall rules and I don’t see anything that would block, plus I would think I’d get a host unreachable error, plus it originally worked for 4 days.

I bet this is something super simple.

I’d really like to get this working so I can get my backups working.

This is going from bad to worse.
During the course of clearing out keys and whatnot trying to get things working, now the direction that was working gave me an ‘authorization error’.
When I deleted the replication task and tried to re-add it now when I try to select the remote system destination for backups I get:

Access denied to replication.list_datasets

This has got to be some lock file or set of keys in the wrong spot.
I could really use some help sorting this out.

As root I tried:

find / -name replication.list_datasets

But it didn’t find anything, so is that an actual file on the system somewhere?

Okay, so that find command’s results are bunk.
I searched on a directory name I knew existed and got no results with that either.

I’m really desperate to get my backups fixed.