Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ssh连接失败,j2ssh给出TransportProtocolException_Ssh_J2ssh - Fatal编程技术网

ssh连接失败,j2ssh给出TransportProtocolException

ssh连接失败,j2ssh给出TransportProtocolException,ssh,j2ssh,Ssh,J2ssh,我正在使用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-

我正在使用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]
我阅读了以下文件:

我转到了我尝试ssh的主机并执行了以下操作:

ssh-qkex

输出为:

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存在


请提供帮助。

您的SSH客户端现在大约有10年的历史,它不支持更现代的服务器的更强大、更安全的算法

我建议(作为您正在使用的API的作者)停止使用它,转而使用其他API。有更多最新的开源JavaSSHAPI可供您使用,包括我自己的J2SSHMaverick、JSch,我相信会有评论为其他人提供案例