Sunday, November 11, 2007

Cygwin sshd RSA host key has just been changed

When you get the following errors from SSHD, you'll never be able to connect to your SSHD server.

bash$ ssh your_id@your_server_ip
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
xx:d3:xx:61:58:xx:fc:ee:1a:xx:da:9a:xx:42:xx:d1.
Please contact your system administrator.
Add correct host key in /home/your_id/.ssh/known_hosts to get rid of this message.
Offending key in /home/your_id/.ssh/known_hosts:52
RSA host key for your_server_ip has changed and you have requested strict checking.
Host key verification failed.
bash$

To fix the problem:
1. Modify .ssh/known_hosts: Remove the line with your_server_ip.
your_server_ip ssh-rsa AAAAB3NzaC1yc2EasdfawAAAIExxVkLHiIpIKDAasdfaxQwUgJ90asdfjoejcxxxkxlKineYdiVb/iZxxxj3yxQf4q2CR8UNuaXJLgmU6G6IrCHtuv0N+xxxyw1cmlRxxx5QEMuYawJmiq87ukcW3zasdfadsffrheF6e7CFwUnD747xxxxxxYN5asdfbcasdfashg5XeymM=
2. bash$ ssh your_id@your_server_ip to try to reconnect to your sshd server.

No comments: