Error Jenkins Failed to connect to repository

0 votes
I'm unable to connect Jenkins on a github repo.

When I specify the repository URL, Jenkins returns the following error message:

Failed to connect to repository : Failed to connect to //Zulaikha12/git-test.git (status = 407)
Jul 6, 2018 in Jenkins by Zulaikha
• 910 points
10,599 views

2 answers to this question.

0 votes

This happens when you create the ssh files with the root user access. This makes root the owner of the files.

The solution is to just change the ownership to the Jenkins user.

chown jenkins id_rsa.pub 
chown jenkins id_rsa
answered Jul 7, 2018 by Sophie may
• 10,620 points
0 votes

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.

answered Aug 7, 2019 by Sirajul
• 59,230 points

Related Questions In Jenkins

+1 vote
1 answer
0 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,995 views
+2 votes
1 answer
0 votes
5 answers

How to resolve this error “Jenkins Host key verification failed”?

HI Mam, Please check the following solution:: 1. Switch ...READ MORE

answered May 3, 2019 in Jenkins by anonymous
61,950 views
0 votes
2 answers

How to solve this error “Jenkins - j_acegi_security_check” ?

This is how I resolved this issue: # ...READ MORE

answered Aug 13, 2018 in Jenkins by lina
• 8,220 points
7,380 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP