src-d / go-git

Project has been moved to: https://github.com/go-git/go-git
https://github.com/go-git/go-git
Apache License 2.0
4.91k stars 542 forks source link

SSH authentication failed twoards Gerrit #1261

Open Mattemagikern opened 4 years ago

Mattemagikern commented 4 years ago

Good morning! I'm having problems authenticating against my companys gerrit server.

What I have tried

  1. Issue eval "$(ssh-agent)" && ssh-add in my terminal running the experiment. This seems to work as expected. Also, don't know if it is needed.
  2. run script provided below:
    
    package main

import ( git "gopkg.in/src-d/go-git.v4" "log" )

var url = "ssh://gerrit.:/path/to/repository"

func main() { _, err := git.PlainClone("app", false, &git.CloneOptions{ URL: url, Progress: nil, }) if err != nil { log.Println(err) } }

Output: `ssh: handshake failed: ssh: unable to authenticate, attempted methods [publickey none], no supported methods remain`

However, When i run `git clone <url>` it work as expected.

I have a `.ssh/config` file and it looks like this:

Host gerrit. User Port



I don't know where to go from here regarding the debugging. I hope you don't mind me asking here, I tried to gain access to your slack but the link had expired.

Best regards,
Måns Ansgariusson
Mattemagikern commented 4 years ago

This will be solved if #1220 is implemented.