Referred from http://www.witheringtree.com/2011/01/how-to-fix-rsa-host-key-change-error-on-mac/
How to Fix RSA Host Key Change Error on Mac
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.
First of all, the error I was getting is below:
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
cd /Users/YOUR_USERNAME/.ssh
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
rm known_hosts
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.
First of all, the error I was getting is below:
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
cd /Users/YOUR_USERNAME/.ssh
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
rm known_hosts
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.