简体   繁体   中英

Link to ssh key when using git on windows

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM