1

我们使用 sshj 库通过 ssh 从 java 连接到远程主机。为此,我们配置了在主机验证期间使用的单个指纹。

一段时间后,我们开始出现随机主机密钥验证错误。在多个 ssh 连接中,只有一些失败

Disconnecting because none of the configured Host key verifiers ([net.schmizz.sshj.transport.verification.FingerprintVerifier$1@1696cbbf]) could verify 'ssh-ed25519' host key with fingerprint ... for ...

据我了解,这是因为主机为不同的算法(、、、)配置了ssh-rsa多个ssh-ed25519密钥ecdsa-sha2-nistp256

  1. 这里正确的方法是什么,我们是否应该添加多个验证器,每个已知密钥一个?
  2. 为什么是随机的?ssh/sshj 使用什么方法来选择正在使用的密钥?
4

0 回答 0