0

I want to use an ssh key when using git from a Windows machine to a Linux server. I have ssh keys already set-up and can connect via ssh through PuTTy. How do I tell git to use this key to connect via ssh?

I have looked through other posts and couldn't find this exact issue

Thanks Tom

1
  • You need to convert the putty key to openssh format
    – Jakuje
    Commented May 27, 2016 at 10:04

1 Answer 1

0

Please create in your windows home directory file: .ssh/config and put into this:

Host <your.git.hostname>
  IdentityFile <path.to.ssh.key.pem>

Now you can try from console:

ssh -v <your.git.hostname>

after this you can see which key file is used


Another way is setting GIT_SSH environment variable to point to plink.exe

2
  • i don't seem to have the ssh command, will installing it screw up putty or is it a case of setting environment variables to find the ssh? Commented May 27, 2016 at 14:51
  • If you install git for windows git-for-windows.github.io I think, that you have ssh command installed with git bash Commented May 27, 2016 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.