Hi, I have rather a strange problem, but as I'm new to Go (but not cruise) I'm sure it's an easy one for someone
Go can't connect to my git hub, which is setup as a private repository, and needs an SSH key configured for access.
In creating a new pipeline I get the chance to test the connection, and Go does this with the following command:
The result is:
However, Git hub is correctly configured with my Public SSH key, thus:rails@webtest1:/var/log/go-server$ ssh -T git@github.com
Hi FooBarGit! You've successfully authenticated, but GitHub does not provide shell access.And running the same command line that fails for Go, works for me:
rails@webtest1:/var/log/go-server$ git ls-remote git@github.com:Foo/Bar.gitc0452f00b1469703acc98bd11da47827c8074843 HEAD
6e2350bb5c17aa55ea1fe1e3676f113e5cf89d13 refs/heads/analytics-work
08a333cf8c6669df77164f148c812b26522c546b refs/heads/expert_page_2
af8609ff19cde6d1a6ed179e64231a8bef77f876 refs/heads/expertrecommendationpageAny ideas?thanks,Guillaume
Comments
7 comments
Cracked it!
Essentially I needed to create a key for go user, and add this to github. Simple as!
I've essentially got the same problem as this. I created a public key whilst logged in as the Go user within the ~/.ssh and uploaded this to my Git repository. I've then done a clone manually on the box to ensure it works, I have made sure there is no passphrase on the key and everything went as expected.
When Go tries to execute git clone I get this error message "Failed to run git clone command ERROR: Permission denied (publickey). ERROR: fatal: The remote end hung up unexpectedly". Any ideas if I put the public key in the right place when I generated it or is there anything else I should of done?
You probably put the go key in the wrong place perhaps. When su to the "go" user, the key was placed by default in /var/go/.ssh
This is what I did (on Ubuntu 11.0.4)
> sudo su go
> ssh-keygen
> ssh-add /var/go/.ssh/id_rsa
I couldn't initially add the key as ssh-agent wasn't running so I had to:
> exec ssh-agent /usr/bin/bash
> ssh-add /var/go/.ssh/id_rsa
then, to get the public key
> cat /var/go/.ssh/id_rsa.pub
Which I copied into github
then, test the connection
> ssh -vT git@github.com
It'll ask you to say yes or no to the connection.
Then it worked.
After more investigation, I installed a Go Server on my machine and it works correctly. On the main server still no joy. The difference I have noticed though is on our production server Go is installed on the E drive so I think there is a posiblity Go is not looking in the correct place for the key files. Not sure how I can prove this ... Git is installed on the C: drive by the way.
Thank you!!! Creating the key for the go user worked.... I did "sudo su" and "su go", then "ssh-keygen -t rsa" and finally "git ls-remote URLtoGit" and accepted the fingerprint. Then, my connection worked.
but what if I try to generate the build in a windows agent, I am having the same problem I just don't found when the go user was created to generate its ssh key, do you know how can I solve this from an windows agent please?
Hello,
This forum is available only for reference. Please redirect your queries to GoCD community.
Thanks,
Anish
Please sign in to leave a comment.