git repository gives 403 error while connecting from jenkins in linux git repository gives 403 error while connecting from jenkins in linux jenkins jenkins

git repository gives 403 error while connecting from jenkins in linux


A bit late, but this solutions works for me. Just change the URL from

 https://github.com/xxxxx/yyyyy.git

to

 https://youruser@github.com/xxxxx/yyyyy.git


Try creating an SSH Key. This will allow passwordless communication between your jenkins server and Github.

Run the following commands from your jenkins server(as root):

sudo su -s /bin/bash jenkinscd ~ssh-keygen -t rsa  (Hit enter for all prompts)cat .ssh/id_rsa.pub

Then, login to the github UI, go to SSH Keys, then paste the output of the last command into a new key.

You should be good to go at this point.


I also faced similar issue when configuring GIT in jenkins. After some investigation I found out that jenkins using default git installation which is 1.7.1 version. Then I installed the latest version and configured jenkins to use the latest version. Click on Maange Jenkins -> Global Tool Configuration -> Git to find the configuration section.

enter image description here