For years we got used to having additional tools for using SSH on Windows clients (PuTTY as the most-common free, or OpenCRT as a commercial one).
Fortunately most common Git programms could make use of PuTTY to use it for Git-over-SSH (you just pointed the GIT_SSH system environment variable to PuTTY's plink.exe).
The big disadvantage was that Git-over-SSH didn't work out very well if you had loaded different SSH keys into PuTTY's authentication agent (Paegant). Git couldn't just select the right one.
Another big disadvantage PuTTY never used the standard (OpenSSH) public and private key, you always needed PuTTYgen program to copy & paste or export these formats out of PuTTY's own .PPK-file format.
So I personally was very curious what will happen now as Microsoft announced to implement the standard OpenSSH for Windows end of 2018.
As always, it seems that there are the following downsides of this procedure:
-
Git Bash not working: It seems as setting GIT_SSH to Windows OpenSSH ssh.exe is breaking ssh_askpass. All tests with setting SSH_ASKPASS / GIT_ASKPASS, DISPLAY or git config credential helpers and askpass vars didn't work.
-
VSCode remote SCM commands not working: You can use VSCode terminal window to fire git remote commands (git pull, git push, ...). When using the SCM provider's icons VSCode seems not to be able to ask for key passphrase. (No, I am NOT recommending to use SSH Keys without passphrase....)
-
Not working with agent: it seems that ssh-agent is not considered by git command...for whatsoever reasons
- Install Windows OpenSSH client AND server component
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
- Generate SSH Key
cd ~\.ssh
ssh-keygen
- Add SSH Key
ssh-add ~\.ssh\id_ed25519
- Point SSH Config to KEY for Git
Host github.com
HostName github.com
User git
IdentitiesOnly yes
ForwardAgent yes
IdentityFile "C:/Users/USERNAME/.ssh/id_ed25519"
Host bitbucket.com
HostName bitbucket.com
User git
IdentitiesOnly yes
ForwardAgent yes
IdentityFile "C:/Users/USERNAME/.ssh/someotherkey"