0

我正在使用 j2ssh-core-0.2.9.jar ssh 到主机。

在日志中我可以看到:

Client Algorithms: [diffie-hellman-group1-sha1]

Server Algorithms: [curve25519-sha256@libssh.org, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group-
exchange-sha256, diffie-hellman-group-exchange-sha1, diffie-hellman-group14-sha1]

我阅读了提供的文档:

https://www.openssh.com/legacy.html

我去了我试图 ssh 并执行的主机:

ssh -Q kex

输出是:

diffie-hellman-group1-sha1
diffie-hellman-group14-sha1
diffie-hellman-group-exchange-sha1
diffie-hellman-group-exchange-sha256
ecdh-sha2-nistp256
ecdh-sha2-nistp384
ecdh-sha2-nistp521
diffie-hellman-group1-sha1
curve25519-sha256@libssh.org

我无法理解如何解决此问题,因为即使在日志中我可以看到服务器的密钥交换方法不包含 diffie-hellman-group1-sha1 但是当我执行 ssh-Q kex 命令时主机,输出显示 diffie-hellman-group1-sha1 存在。

请帮忙。

4

1 回答 1

0

您的 SSH 客户端现在已经使用了大约 10 年,不支持更现代服务器的更强大、更安全的算法。

我建议(作为您正在使用的 API 的作者)停止使用它并转移到不同的 API。有更多最新的开源 Java SSH API 可供您使用,包括我自己的 J2SSH Maverick、JSch,我相信会有评论为其他人提供案例。

于 2018-04-19T11:28:15.183 回答