Sebastien Tardif
Sebastien Tardif

Reputation: 387

On Windows 10 that is well configured with native OpenSSH's ssh-agent, how to have an implementation of git use the ssh-agent configured?

I have configured Native Windows 10 OpenSSH like described here: https://www.makeuseof.com/tag/windows-10-ssh-vs-putty/

Also I have started as a service ssh-agent, added private key, and between restart my private key password's are remembered.

So mainly, I can do the following immediately after a restart without a prompt: ssh -T [email protected]

However, I don't know how to get any implementation of 'git' to delegate the ssh work to the Windows native ssh-agent, so that I can execute without any prompt a clone like: git clone [email protected]:SandboxAtHoopSoft/create-aws-accounts.git

Upvotes: 4

Views: 3153

Answers (2)

mttyd
mttyd

Reputation: 37

Just solved this myself this was a very frustrating journey but for me the following got me going:

  1. Make sure C:\Windows\System32\OpenSSH\ is in your path variables (yea I know Windows should see this on its own)
  2. Go to C:\Users\<your user>\.gitconfig edit your global git config file to point to the correct ssh.exe: C:/Windows/System32/OpenSSH
  3. Make sure your id_rsa.ppk file is in C:\Users\<your user>\.ssh If you don't have an SSH key yet generate one and make sure it ends up in this folder
  4. You may also want to check that your OpenSSH Authentication Agent is started in Windows Services

Upvotes: 2

Sebastien Tardif
Sebastien Tardif

Reputation: 387

Solutions found are:

  • Set OS environment variable:

    set GIT_SSH=C:\WINDOWS\System32\OpenSSH\ssh.exe

OR

  • Set git config:

    git config --global core.sshCommand "'C:\Windows\System32\OpenSSH\ssh.exe'"

Upvotes: 6

Related Questions