duankaolei2921 2017-05-30 20:09
浏览 348

GoLang:“没有通用的密钥交换算法”错误

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条回答 默认 最新

  • dongxian7489 2017-05-30 20:19
    关注

    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:

    1. Convince the server to accept more KEX algorithms; it's possible that it supports more, and someone just configured it super restrictively.
    2. Implement DH Group Exchange for x/crypto/ssh yourself, and send the patch upstream.
    3. Find a different client.
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?