Jenkins: Failed to connect to repository

后端 未结 13 1624
爱一瞬间的悲伤
爱一瞬间的悲伤 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 04:59

    Jenkins runs as another user, not as your ordinary login. So, do as this to solve the ssh problem:

    1. Log on as jenkins su jenkins (you may first have to do sudo passwd jenkins to be able to set the password for jenkins. I couldn't find the default...)
    2. Generate ssh key pair: ssh-keygen
    3. Copy the public key (id_rsa.pub) to your github account (or wherever)
    4. Clone the repo as jenkins in order to have the host added to jenkins known_hosts which is neccessary to do. Now you can remove the cloned repo again if you wish.

提交回复
热议问题