我正在尝试为 sftp 创建 jar。我使用 SSHJ (0.23.0) 并且在测试服务器上一切正常,但问题是当我尝试在生产服务器上运行它时。
我的生产服务器上的 Java 版本是 7u60。
SSHJ 日志:
net.schmizz.sshj.transport.TransportException: **Unable to reach a settlement: [diffie-hellman-group1-sha1] and [curve25519-sha256@libssh.org, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group-exchange-sha256, diffie-hellman-group14-sha1]** at net.schmizz.sshj.transport.Proposal.firstMatch(Proposal.java:165)
at net.schmizz.sshj.transport.Proposal.negotiate(Proposal.java:147)
at net.schmizz.sshj.transport.KeyExchanger.gotKexInit(KeyExchanger.java:239)
at net.schmizz.sshj.transport.KeyExchanger.handle(KeyExchanger.java:364)
at net.schmizz.sshj.transport.TransportImpl.handle(TransportImpl.java:478)
at net.schmizz.sshj.transport.Decoder.decode(Decoder.java:127)
at net.schmizz.sshj.transport.Decoder.received(Decoder.java:195)
at net.schmizz.sshj.transport.Reader.run(Reader.java:72)
Jsch(在我的例子中是 0.1.54,Java 7u60)在测试服务器上也可以正常工作,但在生产服务器中它给了我以下例外:
Jsch日志:
com.jcraft.jsch.JSchException: Algorithm negotiation fail
at com.jcraft.jsch.Session.receive_kexinit(Session.java:520)
at com.jcraft.jsch.Session.connect(Session.java:286)
at com.jcraft.jsch.Session.connect(Session.java:150)
我希望有一个人可以帮助我。