title: Golang sFTP SSH : Authentification Failed
body: <p>For 3 days, I have been trying to set up a sFTP connection to upload a file to a client server.</p>
  
  <p>I'm using this :
  <a href="https://gist.github.com/svett/b7f56afc966a6b6ac2fc" rel="nofollow noreferrer">https://gist.github.com/svett/b7f56afc966a6b6ac2fc</a></p>
  
  <p>Only difference being that I added :</p>
  
  <pre><code>sshConfig := &amp;ssh.ClientConfig{
      User: "0000003579",
      Auth: []ssh.AuthMethod{
          //SSHAgent(),
          PublicKeyFile("C:\\GoDev\\src\\Texel.ca\\Bnc_Ftp\\.ssh\\id_rsa"),
      },
      HostKeyCallback:   ssh.InsecureIgnoreHostKey(),
      HostKeyAlgorithms: []string{"ssh-dss"},
  }
  sshConfig.Ciphers = append(sshConfig.Ciphers, "aes128-cbc")
  </code></pre>
  
  <p>because my client server still use cbc and still use ssh-dss.</p>
  
  <p><strong>My issue :</strong></p>
  
  <p>When trying to connect, I get the following response:</p>
  
  <blockquote>
    <p>Failed to dial: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain</p>
  </blockquote>
  
  <p>I tried to connect with the same credential via openSSH in a command line</p>
  
  <pre><code>ssh -oHostKeyAlgorithms=+ssh-dss ***@2XXX.XXX.XXX.XX -vvv
  </code></pre>
  
  <p>and it works.</p>
  
  <p>Can I get more infos on my error like the -vvv command with openSSH? Or do any of you have an idea?</p>
  
  <p>Thank you!</p>
  
  <p>EDIT</p>
  
  <p>Just for more information, there is a working tool right now that does the sftp transfert and it works.</p>
  
  <p>But it's a .bat file that's why we are changing it to go.</p>
  
  <p>It use WinSCP to connect to the sFTP with a rsa putty private key.</p>
  
  <p>That might be one of the issue, as if I understand correctly, I can't use a puTTy private key with golang ssh package. </p>
  
  <p>So I tried both the putty key and a conversion to openSSH, but both won't work.</p>