Help us understand the problem. What is going on with this article?

SSH接続でREMOTE HOST IDENTIFICATION HAS CHANGED!

More than 1 year has passed since last update.

これもよく知られていることと思われますが,自分への備忘録として.

VirtualBox で何度めかに CentOS 7 の仮想マシンを作成.

【環境】
- Mac
- VirtualBox Version 5.0.32 r112930
- CentOS-7-x86_64-Minimal-1511.iso

【参考サイト】
yk5656 diary: VirtualBoxにCentOS7をインストールしてみる

作成後にホストの Mac から SSH を試みると,
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
の警告メッセージ.

mac$ ssh developer@192.168.56.101
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:t***M.
Please contact your system administrator.
Add correct host key in /Users/hoge/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/hoge/.ssh/known_hosts:5
ECDSA host key for 192.168.56.101 has changed and you have requested strict checking.
Host key verification failed.

解決策はいくつかあるようだが,stack overflow 記事から
ssh remote host identification has changed

ssh-keygen -R <host>

を実行.

mac$ ssh-keygen -R 192.168.56.101
# Host 192.168.56.101 found: line 5
/Users/hoge/.ssh/known_hosts updated.
Original contents retained as /Users/hoge/.ssh/known_hosts.old

再度 SSH を試みて,

mac$ ssh developer@192.168.56.101
The authenticity of host '192.168.56.101 (192.168.56.101)' can't be established.
ECDSA key fingerprint is SHA256:t***M.
Are you sure you want to continue connecting (yes/no)?

yes と答え,

Warning: Permanently added '192.168.56.101' (ECDSA) to the list of known hosts.
developer@192.168.56.101's password: 

PW 入力で,接続〜ログインできた.

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away