ssh "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!"

The line:

Offending key in /home/myaccount/.ssh/known_hosts:7

indicates that the old key is on line 7 of your known_hosts file. Use your favourite editor to delete line 7. That should make it go away.

You can also use ssh-keygen -R to remove a entry:

# ssh-keygen -R hostname -f ~/.ssh/known_hosts

FYI, those are not public keys but a hashed representation of the hosts.

You can list the known hosts file with:

$ ssh-keygen -lv -f ~/.ssh/known_hosts

It will then display the key and ascii art representation:

2048 0f:3b:8a:02:75:f1:68:0f:32:8a:7a:0f:ef:69:f8:a0 |1|aa3F96t0nzhqLpt+lJx4msNAGQI=|740B4+NTrQhAx/DWXHf6QLrBpz8= (RSA)
+--[ RSA 2048]----+
|                 |
|  .              |
|   =             |
|o * .            |
|o= o    S        |
|+   .    +       |
|..o.    o .      |
|..++.o . .       |
|E. *B .          |
+-----------------+

In theory you print this out and keep it in a safe place. When something suspicious happens you have a copy for reference.


I'm going to just add that before taking the advice of my esteemed fellow serverfaulties and erasing the line from your known_hosts file, you should talk to customer service at the other end and make sure that they did do something that would have caused this key change.


You'll need to edit your /home/myaccount/.ssh/known_hosts file and remove the entry that matches the IP address or hostname of your old server. Afterwards, you should just ssh to your server like you normally do and it will prompt you with a new key and ask if you want to add it. Simply say 'yes' and that's that! :) It shouldn't ask you again unless something has changed.

Hope that helps.

EDIT: your known_hosts entry would most likely look something like this

[hostname or IP address] [keytype, generally ssh-rsa] [key here, i.e. ASDFJAKj3klje35u9086095468kjflADf...]