2012年7月7日土曜日

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

閉じた環境でipアドレスを付け替えたりするとsshの認証で文句言われて面倒

ssh 10.x.x.x
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
3d:97:51:10:7e:35:73:95:36:df:b4:a2:78:c3:80:57.
Please contact your system administrator.
Add correct host key in /home/xxx/.ssh/known_hosts to get rid of this message.
Offending key in /home/xxx/.ssh/known_hosts:22
RSA host key for 10.x.x.x has changed and you have requested strict checking.
Host key verification failed.

そんなときは ~/.ssh/config に以下を追加しておけばok

cat <<EOF >> ~/.ssh/config
Host 10.*
  UserKnownHostsFile /dev/null

0 件のコメント:

コメントを投稿