Jenkins: Failed to connect to repository

后端 未结 13 1677
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-03 04:16

I\'m trying to connect jenkins on a github repo.

When I specify the Repo URL jenkins return the following error message:

Failed to connect to

13条回答
  •  心在旅途
    2020-12-03 05:02

    I had the exact same problem. The way I solved it on Mac is this:

    1. Switch to jenkins user (sudo -iu jenkins)
    2. Run: ssh-keygen (Note - You are creating ssh key pairs for jenkins user now. You should see something like this : Enter file in which to save the key (/Users/Shared/Jenkins/.ssh/id_rsa):
    3. Keep pressing Enter for default value till end
    4. Run the command showing in the Jenkins error message, on your teminal (eg : "git ls-remote -h git@github.com:adolfosrs/jenkins-test.git HEAD")
    5. You will be asked if you want to continue. Say yes
    6. The Github repo will be added to your known_hosts file in : /Users/Shared/Jenkins/.ssh/
    7. Go back to Jenkins portal and try your Github SSH url
    8. It should work. Good Luck

提交回复
热议问题