1

When I try to ssh to my server (I reset the server) I get the usual "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!"

I then run the suggested ssh-keygen -f "/home/XXXX/.ssh/known_hosts" -R xxx.com

But this doesn't fix the problem. I cannot delete the known_hosts file because there are a lot of servers in there that I need to keep.

What else am I missing?

0

2 Answers 2

1

Use this command to remove entries from known_hosts:

ssh-keygen -R hostname
2
  • Thanks but nope, it didn't work. Jan 28, 2015 at 12:38
  • Is not possible. Must work. Only if you hostname is wrong or if entry in known-hosts is ip address.
    – 2707974
    Jan 28, 2015 at 12:55
1

The warning should indicate which line the offending host key is on. You can edit the file with nano or vim or your preferred editor and remove just that line, then save and try ssh again.

The file may contain an entry for the hostname and also the server ip, so you may need to remove both.

1
  • None of these worked, I have to delete the file in the end. Who knows what that was about. Jan 28, 2015 at 12:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .