Jenkins Git SSH keys on Windows slave

10,402

Solution 1

If you seen any other messages after this error, could you update your question to include them?

Without seeing them, I can only suspect that git on your Windows slave cannot find the .ssh folder (this folder contains your keys).

Have you already looked at the notes on the Git Plugin page?

Solution 2

Please use C:\Program Files\git\Cmd\git.exe as the git environment variable for the windows slave configuration in Jenkins.

1) Manage Jenkins 2) Manage Nodes 3) Select Windows slave -> go to configuration 4) Add Environment variables for GIT as above complete path.

Also, go to global security settings -> Enable Slave -> Master.

This should work.

Cheers, Ashoka.

Solution 3

You might need to create and fill the ssh folder in the home folder of the windows service at C:\Windows\System32\config\systemprofile.

Source: https://www.techcoil.com/blog/home-directory-of-the-localsystem-account-in-windows-server-2012/

Share:
10,402
nwalke
Author by

nwalke

Updated on June 27, 2022

Comments

  • nwalke
    nwalke almost 2 years

    We currently have a Jenkins master on Windows, an ubuntu slave, and a Windows slave. I'm trying to set up git on the Windows slave. msysgit is installed, and I included the directory in the system path variable so that I can call "git.exe" or "git.cmd" anywhere.

    In my Jenkins configuration, I have a credential with a private SSH key. This credential is for Jenkins to use with Git. This works on the master node and the linux slave. I did not put the private ssh key on either of those two servers, Jenkins handled it for me.

    But the Windows slave, not so much. When I run a job on the windows slave, all I get is ERROR: Error cloning remote repo 'origin'.

    How can I get the credential working on the Windows slave? Or, if you don't think that's the issue, what would be my next troubleshooting steps?