Skip to content

Instantly share code, notes, and snippets.

@taisyo7333
Last active July 2, 2017 05:23
Show Gist options
  • Save taisyo7333/03dbf5f5d4901cd1d18f6ecb96878529 to your computer and use it in GitHub Desktop.
Save taisyo7333/03dbf5f5d4901cd1d18f6ecb96878529 to your computer and use it in GitHub Desktop.
AWS EC2にSSHログインできなくなった件
  • デプロイしなおしたらSSHログインできるようになった。 ただし、原因が何か不明だった。 他にやったこと。

  • 鍵を間違ったかと思い。別の鍵で試した・・・。意味がなかった。

  • ~/.ssh/known_hosts に書いている該当ipアドレスの行を削除したりした。意味無し?

解決

  • 下記ファイルからログインできなくなったホストを削除すると解決する
~/.ssh/known_hosts

Why?? なぜ発生した?

  • AWS ElasticBeanstalkで BlueGreen Deployを行っている。
  • IP アドレスは同じだがデプロイしなおすとインスタンスが変わる。  * 「ECDSA host key」が変わってしまい SSH接続できなくなる。
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:DHuTZAX8w+Z3aVGqLSAMVU6ey2YJRbN9c+dMojGJobQ.
Please contact your system administrator.
Add correct host key in /Users/<user-account>/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/<user-account>/.ssh/known_hosts:37
ECDSA host key for <ip-address> has changed and you have requested strict checking.
Host key verification failed.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The ECDSA host key for <URL> has changed,
and the key for the corresponding IP address <ip-address>
has a different value. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
Offending key for IP in /Users/<user-acount>/.ssh/known_hosts:38
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:PvrPMHaAbbHHnD+rI+0JGE8A/G1ot8h1S+JzU9yEZuA.
Please contact your system administrator.
Add correct host key in /Users/<user-acount>/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/<user-acount>/.ssh/known_hosts:40
ECDSA host key for <xxxx.jp> has changed and you have requested strict checking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment