4

Failure of the composition: married swept: ssh: no common algorithms Error in ss...

 2 years ago
source link: https://www.codesd.com/item/failure-of-the-composition-married-swept-ssh-no-common-algorithms-error-in-ssh-client-for-golang.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Failure of the composition: married swept: ssh: no common algorithms Error in ssh client for golang

advertisements

I'm working on a project that is using goftp to upload to a server, but (thanks to the kind people here) I will use a more secure method.

I plan to use ssh instead and found this ssh client in golang found here.

I have setup an ssh server (freeSSHd) and can successfully connect through PuTTY both locally and on another machine.

I have only changed this part of the client to replace the variables with my own

var (
    server = "127.0.0.1:22"
    username = "username"
    password = clientPassword("password")
)

When I execute the ssh client, ssh.Dial returns an error, and the panic displays this: "Failed to dial: handshake failed: ssh: no common algorithms"

client, err := ssh.Dial("tcp", "127.0.0.1:22", config)
if err != nil {
    panic("Failed to dial: " + err.Error())
}

I am new to golang so I would appreciate any help to point me in the right direction. Thanks in advance.


In the source code for the go.crypto/ssh package, we can see that the supported ciphers are the following:

  • aes128-ctr
  • aes192-ctr
  • aes256-ctr
  • arcfour128
  • arcfour256

While freeSSHd supports:

  • aes128-cbc
  • aes192-cbc
  • aes256-cbc
  • 3des-cbc
  • blowfish-cbc
  • rijndael128-cbc
  • rijndael192-cbc
  • rijndael256-cbc
  • [email protected]

Because the client and server shares no common cipher, you will get the error message. The reason why CBC mode is not supported in the ssh package is most likely because of a vulnerability, as discussed in this golang-nuts thread.

A solution to your problem might be to try install a different SSH server, such as OpenSSH for Windows.

Tags ssh

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK