Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

手动ssh没问题,cachecloudssh报错 #302

Open
macoli opened this issue Mar 9, 2023 · 6 comments
Open

手动ssh没问题,cachecloudssh报错 #302

macoli opened this issue Mar 9, 2023 · 6 comments

Comments

@macoli
Copy link

macoli commented Mar 9, 2023

cachecloud上配置了ssh后,日志中报错,但是手动去ssh连接是正常的。
系统版本:CentOS Linux release 7.9.2009
java version "1.8.0_212"

2023-03-09 12:03:02.514 ERROR 10639 --- [h-pool-thread-1] com.sohu.cache.ssh.SSHTemplate : getConnection xx.xx.xx.xx:22 error message is There was a problem while connecting to xx.xx.xx.xx:22

java.io.IOException: There was a problem while connecting to xx.xx.xx.xx:22
at ch.ethz.ssh2.Connection.connect(Connection.java:699)
at com.sohu.cache.ssh.SSHTemplate$1.execute(SSHTemplate.java:102)
at com.sohu.cache.util.IdempotentConfirmer.run(IdempotentConfirmer.java:27)
at com.sohu.cache.ssh.SSHTemplate.getConnection(SSHTemplate.java:122)
at com.sohu.cache.ssh.SSHTemplate.execute(SSHTemplate.java:50)
at com.sohu.cache.ssh.SSHUtil.getMachineInfo(SSHUtil.java:73)
at com.sohu.cache.machine.impl.MachineCenterImpl.collectMachineInfo(MachineCenterImpl.java:144)
at com.sohu.cache.machine.impl.MachineCenterImpl$1.execute(MachineCenterImpl.java:118)
at com.sohu.cache.machine.impl.MachineCenterImpl$1.execute(MachineCenterImpl.java:115)
at com.sohu.cache.async.KeyCallable.call(KeyCallable.java:22)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Key exchange was not finished, connection is closed.
at ch.ethz.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:91)
at ch.ethz.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:229)
at ch.ethz.ssh2.Connection.connect(Connection.java:655)
... 13 common frames omitted
Caused by: java.io.IOException: Cannot negotiate, proposals do not match.
at ch.ethz.ssh2.transport.KexManager.handleMessage(KexManager.java:412)
at ch.ethz.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:753)
at ch.ethz.ssh2.transport.TransportManager$1.run(TransportManager.java:468)
... 1 common frames omitted

@githubname1024
Copy link
Collaborator

请问ssh要连接的机器的系统也是CentOS Linux release 7.9.2009吗?

@macoli
Copy link
Author

macoli commented Mar 14, 2023

是的,被ssh的机器提示如下:
sshd[32664]: Unable to negotiate with xx.xx.xx.xx port 15639: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 [preauth]

看记录应该是不支持ssh协议,当前系统只支持
kexalgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256

@githubname1024
Copy link
Collaborator

可以按照网上解决方式,修改一下KexAlgorithms。

@macoli
Copy link
Author

macoli commented Mar 14, 2023

当前已通过修改KexAlgorithms解决了,不过cachecloud能否支持更多的ssh协议呢

@githubname1024
Copy link
Collaborator

我们后边会评估考虑。另外,也欢迎提交pull request。

@PaimonAllen
Copy link

Hi, here is the same problem in Ubuntu 20.04.
Caused by: java.io.IOException: Key exchange was not finished, connection is closed.
at ch.ethz.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:91)
at ch.ethz.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:229)
at ch.ethz.ssh2.Connection.connect(Connection.java:655)
... 14 common frames omitted
Caused by: java.io.IOException: Cannot negotiate, proposals do not match.
at ch.ethz.ssh2.transport.KexManager.handleMessage(KexManager.java:412)
at ch.ethz.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:753)
at ch.ethz.ssh2.transport.TransportManager$1.run(TransportManager.java:468)
... 1 common frames omitted

and log in Ubuntu 20.04 /var/log/auth.log
Unable to negotiate with ... port 63183: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 [preauth]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants