title: How to access remote Git repositories using Jenkins Freestyle Project
body: <p>I have a Jenkins installation into my Mac, it is the <code>jenkins.war</code> inside my <code>/Users/myuser/jenkins folder</code>. Ran it the first time and Jenkins creates <code>/Users/mysuer/.jenkins</code> folder and deploy the artefacts there. Running it I'm going to <code>/Users/myuser/jenkins/java -jar jenkins.war</code>.</p>
  <p>Additionally I created free style project that it using Git as a source code repository and is suppose to be connected each 5 minutes to and external repo that is into a raspberry pi 4.</p>
  <p>Setup an rsa ssh key that was generated into the MacOS side and use it to connect via ssh to the raspberry and it not any problem.</p>
  <p>Additionally setup on the Jenkins credentials as follows:</p>
  <pre><code>Scope: Global (Jenkins, nodes ... )
  Id: Some id
  Description: Some description
  Username: My-MacOS-User
  Private Key: The private key generate into my Mac side (id_rsa)
  Password: The private key passoword
  </code></pre>
  <p>And when try to run the project always getting:</p>
  <pre><code>Failed to connect to repository : Command &quot;git ls-remote -h -- ssh://pi@raspberrypi/home/pi/server/git/myRepo HEAD&quot; returned status code 128:
  stdout: 
  stderr: Permission denied, please try again. 
  Permission denied, please try again. 
  pi@raspberrypi: Permission denied (publickey,password). 
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights and the repository exists.
  </code></pre>
  <p>Uploaded the public and the private key into <code>/home/pi/.ssh</code>, created <code>.ssh</code> folder into the <code>./.jenkins</code> folder with the <code>id_rsa</code> and <code>id_rsa.pub</code>
  Added the <code>.ssh</code> to the <code>./jenkins</code> folder too
  Created a config file</p>
  <p>And none of them seems to work ....</p>
  <p>Any ideas how to setup properly</p>