Yesterday when I tried to ssh to remote EMR cluster, it raised this problem

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
[ec2-user@ds-uat-airflow1 ~]$ ssh -i ~/YOUR_SECRET.pem hadoop@ip-YOUR_IP_ADDRESS.us-west-2.compute.internal
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:XXXXXX.
Please contact your system administrator.
Add correct host key in /home/ec2-user/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/ec2-user/.ssh/known_hosts:67
ECDSA host key for ip-YOUR_IP_ADDRESS.us-west-2.compute.internal has changed and you have requested strict checking.
Host key verification failed.

The warning message looks terror but the actual solution is quite simple. You can just solve this by erase the corresponding record in your ~/.ssh/known_hosts file.

For me I just clean the entire file and then retry to ssh to the server and it works.

Reference