How to fix the bug “REMOTE HOST IDENTIFICATION HAS CHANGED”

Henry Coder
bugfixed
Published in
Nov 15, 2023

Here is the method that set up automatic SSH login to AWS EC2 instance.

After set up, you only need input the following code to login:

ssh ec2xxx

But sometimes, bug happens:

Directly Edit the Known Hosts File: You can manually open the known_hosts file located at /Users/henrywu/.ssh/known_hosts and look for entries related to IP or Domain. If you find any, you can delete those lines. Be cautious while editing to not remove unrelated entries.

Ctrl+K, delete the line

Then run the code again:

ssh ec2xxx

--

--