Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error using amazon EC2(ubuntu)

I just started using amazon EC2 and I use it via cygwin on windows to run ubuntu. I recently tried logging in to my EC2 instance by ssh and I got this error message

@    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...
 Host key verification failed.

What is this, and how I do I get around this?

like image 725
Omiye Jay Jay Avatar asked Mar 23 '23 06:03

Omiye Jay Jay


2 Answers

This means the SSH server is presenting a different RSA key than when you first connected to the server on this IP address. If you changed the instance running on this IP address/hostname, this should be expected.

If this is a completely unexpected error message, this is for your own protection. There's a chance someone could be doing something malicious and monitoring the connection.

If you want to override it, go to C:\Users\[your username]\.ssh\known_hosts and remove the offending line that starts with the hostname and/or IP address of the SSH server. Then reconnect to the server.

like image 100
Steven V Avatar answered Mar 25 '23 20:03

Steven V


just use

ssh-keygen -R hostname

example ssh-keygen -R 168.9.9.2

This will update the offending of your host from the known_hosts

like image 42
ravi ranjan Avatar answered Mar 25 '23 20:03

ravi ranjan