web-dev-qa-db-ja.com

Ubuntu-ssh--警告:リモートホストの識別が変更されました

リモートシステムにsshおよびrsyncできません。このエラーメッセージを出し続けます:

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 RSA key sent by the remote Host is
a3:8f:7c:07:c9:12:d8:aa:cd:c2:ba:b3:27:68:bc:c2.
Please contact your system administrator.
Add correct Host key in /root/.ssh/known_hosts to get rid of this message.
Offending RSA key in /root/.ssh/known_hosts:8
RSA Host key for xxx.xxx.xxx.xxx has changed and you have requested strict checking.
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.8]

authorized_keysから/home/user/.sshファイルを削除しました。

61
thiyagu114

メッセージには「/root/.ssh/known_hosts "not authorized_keys。そのファイル(または少なくとも対応するキー)を削除すると、再度アクセスできます!ただし、キーが変更された理由が必要です。システムを再インストールしましたか?またはsshの概念全体が無効です。

ところで:あなたがrootとしてsshする理由はありますか?

69
Nikodemus RIP

.ssh/known_hostsファイルから古いキーを削除する次のコマンドを使用します

ssh-keygen -R <Host>
124
Talespin_Kit

メッセージはそれ自身を説明しています:

  • リモートホストがキーで自身を識別しました
  • そのホストのキーの以前のコピーが異なります
  • そのため、リモートホストが、自分が言っている人ではない可能性があります

リモートホストを信頼する場合、/ root/.ssh/known_hostsから8行目を削除すると、sshは次に接続しようとするときに新しいキーを追加できるかどうかを尋ねます。

リモートホストを信頼していない場合は、ホスト管理者に連絡して、sshキーを変更したかどうかとその理由を確認する必要があります。そうでない場合は、トラフィックが傍受されていることを意味します

一方、リモートホストを本当に信頼している場合(たとえば、イントラネット上にある場合)、次のコマンドでsshを実行できます。

-oBatchMode=yes -oStrictHostKeyChecking=no
20
Alftheo

Sedを使用して、8 known_hostsファイルから:

sed -i -e 8d /root/.ssh/known_hosts
12
Pierz

これを行うだけです:

mv .ssh/known_hosts .ssh/known_hosts_old
5
user1421092