“Algorithm negotiation fail” error in Eclipse when trying to connect by SSH to a personal Git Server

浪子不回头ぞ 提交于 2020-01-15 18:49:02

问题


I have Eclipse Juno, a Synology Server DS213+ with a Git Server. I'm trying to checkout a project from my Git Server to my workspace and when I use EGit in Eclipse I have this error:

org.eclipse.jgit.api.errors.TransportException: ssh://[route]/volume1/Git/project.git: Algorithm negotiation fail
    at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:223)
    at org.eclipse.jgit.api.LsRemoteCommand.call(LsRemoteCommand.java:159)
    at org.eclipse.egit.core.op.ListRemoteOperation.run(ListRemoteOperation.java:99)
    at org.eclipse.egit.ui.internal.clone.SourceBranchPage$8.run(SourceBranchPage.java:324)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.jgit.errors.TransportException: ssh://[route]/volume1/Git/project.git: Algorithm negotiation fail
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:159)
    at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:136)
    at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
    at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
    at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:202)
    ... 4 more
Caused by: com.jcraft.jsch.JSchException: Algorithm negotiation fail
    at com.jcraft.jsch.Session.receive_kexinit(Session.java:583)
    at com.jcraft.jsch.Session.connect(Session.java:320)
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
    ... 8 more

[route] is correct and works fine in other git softwares


回答1:


I found this blog with the solution:

http://blog.millard.org/2014/11/repair-synology-dsm51-for-use-as-linux.html

Using WinSCP http://winscp.net/eng/download.php I modified sshd_config and restart ssh in the Control Panel of Synology.




回答2:


Egit in Eclipse seems to throw this error when it does not support any of the chipers supported the the ssh server. In my case, the SSH server was set to only accept a handful of strong chipers. I noticed errors similar to the following on the server's ssh logs:

fatal: Unable to negotiate with xx.xx.xx.xx port 12345: no matching cipher found. Their offer: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc

The reason for the error on the client was because the default Java install did not support any of the strong chipers. Since we were already using the webupd8 team ppa to install our Java packages, the solution was to simply install the unlimited-jce-policy package.

apt install oracle-java8-unlimited-jce-policy

Restart Eclipse and you're all set.




回答3:


Eclipse require diffie-hellman-group1-sha1

Modify /etc/ssh/sshd_config and add it to Ciphers like:

Ciphers 3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com
macs umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
kexalgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1


来源:https://stackoverflow.com/questions/29797017/algorithm-negotiation-fail-error-in-eclipse-when-trying-to-connect-by-ssh-to-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!