At work recently, we wiped a Fedora development server and reinstalled with the newer version of the OS. When everything was back up and running, I tried to connect to it through SSH. I got an error I hadn’t seen before about my RSA host key is wrong.
This was actually pretty easy to fix. Since you are already trying to SSH, this assumes you already know where Terminal is and you have it opened:
1) Inside Terminal, type
Where YOUR_USERNAME is your login name for your Mac. If you don’t what what it is, your login name is the word right before the $ in the Terminal window.
2) Inside Terminal again, type
That’s it. Your done. You can now go through SSH again. A new RSA key will be generated for you automatically. All this really did was delete a file named known_hosts inside the hidden /Users/YOUR_USERNAME/.ssh directory. Since it deleted the file, this also means that RSA keys for other SSH connections will be lost as well. However the next time you SSH to them, you will be given a new key automatically.