Authenticate Jenkins CI for Github private repository

0 votes
I want Jenkins to automatically fetch data from my private repo hosted on github.

I tried generating the ssh key for Jenkins user and the only thing I can see is “unable to clone the repo”.
Aug 13, 2018 in Jenkins by Hannah
• 14,080 points
169 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

when you have a server that needs pull access to a single private repo. This key is attached directly to the repository instead of to a personal user account.

If you have a Jenkins user, you can store your deploy key in ~/.ssh/id_rsa. When Jenkins tries to clone the repo via ssh, it will try to use that key.

In some setups you cannot use the default ssh key location. In such cases you create a key in different location(~/.ssh/deploy_key) and configure ssh in ~/.ssh/config.

Host github-deploy-myproject
    HostName       github.com
    User           git
    IdentityFile   ~/.ssh/deploy_key
    IdentitiesOnly yes

we create a host alias github-deploy-myproject because you don’t want to use the above keys to all your github connections. Your clone URL now becomes

git clone github-deploy-myproject:myuser/myproject
answered Aug 13, 2018 by Kalgi
• 35,800 points

Related Questions In Jenkins

0 votes
1 answer

Which is better jenkins of TFS 2015 for CI/CD?

Visual Studio and TFS have been using ...READ MORE

answered Aug 21, 2018 in Jenkins by ajs3033
• 7,040 points
182 views
0 votes
1 answer

Why is it displaying Jenkins build failure for Android app

I think you should try this. Try Uninstalling ...READ MORE

answered Apr 12, 2018 in Jenkins by shubham
• 6,500 points
160 views
0 votes
2 answers

Is possible for Jenkins to auto start and stop slave nodes?

Try Jenkins Plugin called as Slave SetupPlugin. This ...READ MORE

answered Aug 6, 2018 in Jenkins by Nilesh
• 6,900 points
426 views
0 votes
1 answer

Error while communicating with remote Oracle DB through Jenkins-CI

I was also facing the same problem. ...READ MORE

answered Apr 25, 2018 in Jenkins by shubham
• 6,500 points
58 views
+13 votes
2 answers
0 votes
1 answer
+1 vote
3 answers
+2 votes
4 answers

Jenkins integration for dotnet test

You can use the following Pipeline code ...READ MORE

answered Aug 8, 2018 in Jenkins by Kalgi
• 35,800 points
636 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.