简体   繁体   English

ssh连接失败,j2ssh给出TransportProtocolException

[英]ssh connection fails with j2ssh giving TransportProtocolException

I'm using j2ssh-core-0.2.9.jar to ssh to a Host. 我正在使用j2ssh-core-0.2.9.jar SSH到主机。

In the logs I can see : 在日志中,我可以看到:

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]

I read the documentation provided on : 我阅读了提供的文档:

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

I went to the host to which I'm trying to ssh and executed : 我去了我要ssh并执行的主机:

ssh -Q kex ssh -Q kex

The output is : 输出为:

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

I'm not able to understand how i can resolve this issue, because even though in the logs i can see that the server's key exchange methods do not contain diffie-hellman-group1-sha1 but when i execute the ssh-Q kex command on the host, the output shows that diffie-hellman-group1-sha1 is present. 我无法理解如何解决此问题,因为即使在日志中我也可以看到服务器的密钥交换方法不包含diffie-hellman-group1-sha1,但是在执行ssh-Q kex命令时主机,输出显示diffie-hellman-group1-sha1存在。

Please help. 请帮忙。

Your SSH client, which is now roughly 10 years old does not support the stronger, more secure algorithms of more modern servers. 您的SSH客户端(大约已有10年的历史了)不支持更现代服务器的更强大,更安全的算法。

I recommend (as the author of the API you are using) that you stop using it and move to a different API. 我建议(作为您使用的API的作者)停止使用它,而转到另一个API。 There are plenty more up-to-date open source Java SSH APIs available to you including my own J2SSH Maverick, JSch and I'm sure there will be comments providing the case for others. 有很多更新的开源Java SSH API供您使用,包括我自己的J2SSH Maverick,JSch,我敢肯定会有评论为其他人提供案例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM