To make a long story short, this issue is resolved. The Jenkins account on 
Gerrit was removed and recreated, after which I was able to successfully 
push the ssh key pair.

On Thursday, October 15, 2020 at 2:25:46 PM UTC-4 PAUL MENA wrote:

> I am in the process of trying to migrate Gerrit and Jenkins to a new 
> datacenter. I have successfully installed the applications on their new 
> hardware, but am having difficulty getting Jenkins to read from a Gerrit 
> repository on the same server.
>
> As the Jenkins user already existed on the server, I updated its ssh keys 
> using one I generated from my account on my laptop (pablo@mena-xps), using 
> the following command:
>
> cat ~/.ssh/id_rsa.pub | ssh -p 29418 pmena@gerrit_host gerrit set-account 
> --add-ssh-key - jenkins 
>
> I confirmed that I am able to use this key to interrogate gerrit from my 
> laptop: 
>
> pablo@mena-xps=> ssh -p 29418 pmena@gerrit_host gerrit version 
> gerrit version 2.10
>
> On the Jenkins server, I added the Private key under "Credentials" and 
> then Configured the specific job to use that key to access a specific 
> gerrit repo. That returns the following error in the GUI: 
>
> Failed to connect to repository : Command "git -c core.askpass=true 
> ls-remote -h ssh://gerrit_host:29418/my_repo HEAD" returned status code 
> 128: 
> stdout: 
> stderr: Permission denied (publickey). 
> fatal: Could not read from remote repository. Please make sure you have 
> the correct access rights and the repository exists. 
>
> How can I go about troubleshooting this issue? Is there something I've 
> overlooked in my approach? Thanks in advance.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/679b6d5c-a753-4926-8fd0-cab6d9ab6a24n%40googlegroups.com.

Reply via email to