Windows: Use PuTTY for git SSH (Or any SSH agent)

Joshua Toth
Mar 5, 2018 · 1 min read

Something that seems to come up a lot when using git on windows is wanting to use an SSH client to manage keys. When you want to use something like PuTTY its a fairly simple, but somewhat hidden process.

By default, git will look in your C:\Users\<username>\.ssh for an id_rsa key and load that.

To get git to load keys from an SSH client instead, you need to add an environment variable (GIT_SSH) pointing to the directory of the client you are using:

Image for post
Image for post

The next time you open a command line tool (cmd/powershell/mingw) git will use the SSH agent instead of loading the id_rsa key.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store