経緯
MacOSからwsl(ubuntu)へssh接続しようとした際、なかなかうまくいかず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 ED25519 key sent by the remote host is
SHA256:aoisudhfaeirgjbriubseubhrdjbslid.
Please contact your system administrator.
Add correct host key in /Users/user/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/user/.ssh/known_hosts:7
Host key for [ip]:port has changed and you have requested strict checking.
Host key verification failed.
解決策
~/.ssh/known_hostsのファイルを削除することでホストの再登録ができる。
rm ~/.ssh/known_hosts