JSch: UnknownHostKey exception even when the hostkey fingerprint is present in the known_hosts file

前端 未结 1 376
悲哀的现实
悲哀的现实 2020-12-10 17:50

There are two questions about this exception already:

  • JSchException: UnknownHostKey and
  • com.jcraft.jsch.JSchException: UnknownHostKey

I

相关标签:
1条回答
  • 2020-12-10 18:38

    The problem is that you have added ECDSA host key to the known_hosts, as the ssh prefers that key type:

    ECDSA key fingerprint is 11:5d:55:29:8a:77:d8:08:b4:00:9b:a3:61:93:fe:e5.

    But JSch prefers RSA key, which it won't find in the known_hosts:

    RSA key fingerprint is 50:db:75:ba:11:2f:43:c9:ab:14:40:6d:7f:a1:ee:e3


    You probably need JCE to enable ECDSA In JSch.

    See JSch Algorithm negotiation fail.


    Or make ssh use RSA key with -o HostKeyAlgorithms=ssh-rsa.

    See How can I force SSH to give an RSA key instead of ECDSA?

    0 讨论(0)
提交回复
热议问题