SSH指紋の不一致

SSH指紋の不一致
  • Host_aはmacOSです

  • Host_bはUbuntuです

  • host_b は host_a の既知のホストにあります。

  • Host_a は host_b の Known_hosts にありません。

簡潔さのために指紋を変更していくつかの出力をトリミングしましたが、それ以外はこれが一連のイベントです。

非常にランダムに、私は(known_hostsの)host_bでsshを試み、リモートホストの警告を受け取ります。

me@host_a:~ $ ssh host_b                
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:9rxxxxxxxxxxxxxxxxxxxxxxxxxNI.
Please contact your system administrator.
Add correct host key in /Users/me/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/me/.ssh/known_hosts:6
Host key for host_b has changed and you have requested strict checking.
Host key verification failed.

それからすぐにやり直してみましたが、効果がありました。

me@host_a:~ $ ssh host_b
Last login: Sat Feb 11 11:49:59 2023 from 10.0.1.50
me@host_b:~$

その後、SSHを介して再びhost_aに接続しようとします(不明)。

me@host_b:~$ ssh host_a
The authenticity of host 'host_a (10.0.1.50)' can't be established.
ED25519 key fingerprint is SHA256:9rxxxxxxxxxxxxxxxxxxxxxxxxxNI.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? ^C
me@host_b:~$ exit

奇妙なことに、Host_aの指紋は、Host_bが最初の試みで自分自身を識別するために使用したと言ったのと同じです。

再びHost_aに戻って指紋を確認しようとしています。

me@host_a:~ $ ssh-keyscan host_b | ssh-keygen -lf - 
...
256 SHA256:7gxxxxxxxxxxxxxxxxxxxxxxxxxOA host_b (ED25519)
...
me@host_a:~ $ ssh-keyscan host_a | ssh-keygen -lf - 
...
256 SHA256:9rxxxxxxxxxxxxxxxxxxxxxxxxxNI host_a (ED25519)
...

localhostまたは127.0.0.1(host_a以外)でssh-keyscanを実行すると、同じ指紋が生成されます。

これはランダムに発生します。約10〜15分間host_bにsshを接続しないと、最初の試みでリモートホストの指紋が一致しないという警告が表示されます(常に実際のホストの指紋です!)。

私のホームネットワークに悪意のあるものがないと確信しています。しかし、この問題の原因は何ですか?

ベストアンサー1

おすすめ記事