I've setup Jenkins to pull from a private repository on Github for a specific job. It appears the SSH key is not being used by Jenkins, despite the fact that I have generated a private/public key and added it to github as a deploy key.
When I git clone from the Jenkins user, I'm prompted for a username and password. Why isn't it using my ~/.ssh/id_rsa.pub key?
Thanks
Which url are you using? It sounds like you are using the https one instead of the ssh one.
At the top of your projects github page, there are buttons for three urls, HTTP, SSH, Git read-only. You want the SSH one.
Just had the same problem, here is what you can do :
1) Login as jenkins users
sudo su jenkins
2) Generate keys for the jenkins user :
ssh-keygen -t rsa
3) Enter the id_rsa.pub as deploy key in the admin section of your repo on GitHub
Or even better :
Hope this helps, Vincent
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With