How to use the ~/.ssh/config file with Pageant under windows


I am using Pageant on my Windows machine to manage my SSH key. I have used ssh-agent before, but since Vagrant does not use ssh but net-ssh on vagrant up/provisioning I need to have my key in Pageant to use agent forwarding there.

I heavily use my ~/.ssh/config file to configure host shortcuts, keys they should use etc.

The .ppk file that pageant uses is not compatible with the ssh client, so I can not put it in the IdentifyFile directive.

I could, of course, let my ssh-agent run, too, but this kind of duplicates everything.

How do I combine pageant with my ssh client?

To clarify what I want to do:

  1. Add my SSH-Key to Pageant
  2. Configure in the ~/.ssh/config as 'myhost'
Host myhost
    User calo
    IdentityFile ~/.ssh/myhost
  1. Open up a git bash and type ssh myhost to connect to my host without having to put down my password again, because it would be taken from the pageant.

Best Answer

It can be done. You need to:

  1. create windows environment variable named GIT_SSH
  2. put the path to your plink.exe as value, for me it was:
    C:\Program Files\PuTTY\plink.exe
  3. logout & login (or restart your compouter)
  4. you should be done, you can confirm yourself you have set the variable right by git bash command:
    $ export
    (shows all env variables)