3

I'm using the Visual Studio Code Remote - SSH extension on a Windows 10 laptop to access a bunch of Linux development servers. I followed these instructions to set up the Windows built-in ssh-agent service, which is basically a few lines in an Administrator PowerShell terminal...

Set-Service ssh-agent -StartupType Automatic
Start-Service ssh-agent
Get-Service ssh-agent

This allows me to run ssh-add from a Command Prompt to install a private key, after which ssh, scp, sftp etc can connect to the remote host without needing the key passphrase, as can VSCode itself.

I also have Cygwin installed on the laptop, so my question is: how do I configure it so that those instances of the OpenSSH programs can access the Windows ssh-agent service? I guess there's a magical setting for SSH_AUTH_SOCK but how do I find out what it is? Yes, I could use keychain to load keys into a Cygwin-hosted ssh-agent process, but that means I have to type all the passphrases twice.

For now I've simply uninstalled the OpenSSH package in Cygwin so that bash runs the Windows version of ssh etc from /cygdrive/c/Windows/System32/OpenSSH, but I'd like to do it properly instead. Thanks for your help!

kbro
  • 260
  • 1
  • 2
  • 12
  • 1
    Uninstalling Cygwin OpenSSH isn't a good solution after all because it messes up Emacs Ange-FTP - the ssh commands Tramp uses don't work with the Windows version of command-line programs. – kbro May 21 '21 at 11:13
  • 1
    Have you figured this out? It's not just Cygwin, but also the SSH command that Git-Bash distributes that would benefit from this... – Alexandros Jun 05 '22 at 23:16

0 Answers0