Background
I have a remote server and have reinstalled the system via a browser.
Symptom
After I added the ssh public key to the new remote server from my browser, I tried to login from my computer using the terminal, but it failed and showed the following error:
|
|
Reason
When we connect to the server via SSH, ssh will get a fingerprint of the ECDSA key and save it to the home directory under ~/.ssh/known_hosts
at the first time. SSH will query the file every time you connect to that server after that. After I have changed the server, the fingerprint has been changed, so it’s not the same with the local in the file known_hosts.
Soultion
Use ssh-keygen
Both hostname and ip will work after ssh-keygen -R
|
|
Remove the record in the file ~/.ssh/known_hosts
Open the file ~/.ssh/known_hosts
and remove the record about the ip 192.168.0.100.