Jsch 0.1.54 session.connect()抛出com.jcraft.Jsch.jscheexception:session.connect:java.io.IOException:io流读取结束
我使用下面的代码连接到ssh服务器Jsch 0.1.54 session.connect()抛出com.jcraft.Jsch.jscheexception:session.connect:java.io.IOException:io流读取结束,session,ssh,Session,Ssh,我使用下面的代码连接到ssh服务器 JSch jsch = new JSch(); Session session = jsch.getSession("username", "ip", port); Properties config = new Properties(); config.put("kex", "diffie-hellman-group1-sha1"); config.put("StrictHostKeyChecking", "no"); session.setConfig(c
JSch jsch = new JSch();
Session session = jsch.getSession("username", "ip", port);
Properties config = new Properties();
config.put("kex", "diffie-hellman-group1-sha1");
config.put("StrictHostKeyChecking", "no");
session.setConfig(config);
session.setPassword("password");
session.connect(5000); // Exception raises here
例外情况如下所示
com.jcraft.jsch.JSchException: Session.connect: java.io.IOException: End of IO Stream Read
由于我没有获取日志(由于应用程序的限制),我通过WireShark捕获了会话,它显示了ssh服务器在密钥交换期间发送的重置请求。
附加相同的屏幕截图
在上图中,xx.xx.xx.29是我的机器,xx.xx.xx.51是ssh服务器ip
我没有在其他线程中找到任何解决方案。请帮助我。有关许多答案,请查看kex online。
会话。SetConfig(kex“,“diffie-hellman组1--sha1”)代码>有解决方案吗?我也面临同样的问题。