英文:
GoLang : "No common algorithm for key exchange" error
问题
我是你的中文翻译助手,以下是翻译好的内容:
我是GoLang的新手,我正在尝试使用Go语言连接到远程服务器。但是我一直遇到以下错误:
连接失败:ssh: 握手失败:ssh: 密钥交换没有共同算法;客户端提供的算法:[curve2****-sh****@libssh.org ****-sha*-nis****ecdh-sha2-nistp384 ecdh-sha2-nistp**** diffie-hellman-group14-sha1 diffie-hellman-group1-sha1];服务器提供的算法:[diffie-hellman-group-exchange-sha***]
以下是我用于连接的配置:
config := &ssh.ClientConfig{
User: user,
HostKeyCallback: nil,
Auth: []ssh.AuthMethod{
publicKey,
},
}
英文:
I am new to GoLang and I am trying to connect to a remote server using go. But I keep getting the following error
Failed to dial: ssh: handshake failed: ssh: no common algorithm for key exchange; client offered: [curve2****-sh****@libssh.org ****-sha*-nis****ecdh-sha2-nistp384 ecdh-sha2-nistp**** diffie-hellman-group14-sha1 diffie-hellman-group1-sha1], server offered: [diffie-hellman-group-exchange-sha***]
below is the config that I use to connect
config := &ssh.ClientConfig{
User: user,
HostKeyCallback: nil,
Auth: []ssh.AuthMethod{
publicKey,
},
}
答案1
得分: 2
好的,以下是翻译好的内容:
嗯,就像错误信息所说的那样,客户端和服务器没有任何它们愿意达成一致的算法,所以它们无法通信。Go提供的六种算法是它支持的所有算法(在openssh的12种算法中);而服务器只提供了一种不属于这些算法的算法。你有以下几个选择:
- 说服服务器接受更多的KEX算法;有可能服务器支持更多算法,只是有人将其配置得非常严格。
- 自己为x/crypto/ssh实现DH Group Exchange,并将补丁提交上游。
- 寻找其他的客户端。
英文:
Well, like the error says, the client and the server don't have any algorithms they're willing to agree on, so they can't talk. The six that Go is offering are all the ones it supports (out of the 12 that openssh does); the server is only offering one that isn't any of those. Your options:
- Convince the server to accept more KEX algorithms; it's possible that it supports more, and someone just configured it super restrictively.
- Implement DH Group Exchange for x/crypto/ssh yourself, and send the patch upstream.
- Find a different client.
答案2
得分: 0
请看一下这个问题。
我还在解决这个问题,但VonC提供了一些有趣的提示来解决它。
希望对你有帮助。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论