2

I am having trouble using the remote-ssh plugin in Visual Studio between machine A and machine B where the key is provided by KeeAgent from a KeePass database on machine A.

Machine A runs on Windows 10 and I have set up the Host (machine B) in Visual Studio Code correctly according to the guide. However, when trying to use the remote feature, I get the following error:

[09:48:32.111] Log Level: 2
[09:48:32.121] remote-ssh@0.51.0
[09:48:32.121] win32 x64
[09:48:32.124] SSH Resolver called for "ssh-remote+XXX.XXX.XXX.XXX", attempt 1
[09:48:32.125] SSH Resolver called for host: XXX.XXX.XXX.XXX
[09:48:32.125] Setting up SSH remote "XXX.XXX.XXX.XXX"
[09:48:32.314] Using commit id "91899dcef7b8110878ea59626991a18c8a6a1b3e" and quality "stable" for server
[09:48:32.317] Install and start server if needed
[09:48:38.141] getPlatformForHost was canceled
[09:48:38.142] Resolver error: Connecting was canceled
[09:48:38.147] ------

where XXX.XXX.XXX.XXX obviously is the correct IP of machine B in my output.

As I mentioned, the SSH key for this machine is provided via KeeAgent and works fine with PuTTy. I am not allowed to store a SSH key in plaintext on machine A, hence the Keepass/KeeAgent solution. I guess this is the Problem, that somehow Visual Studio Code does not work with KeeAgent.

Can I work around this, i.e. by telling VS Code to use plink.exe as SSH client, which works with KeeAgent? Or does VS Code allow the encrypted storage of SSH keys itself, thereby making KeeAgent obsolete? I am new to both VS Code and the remote-ssh plugin, so I'm sorry if my questions have obvious solutions.

Maybe the problem lies elsewhere though. In that case I am thankful for every hint.

Thanks!

fratajcz
  • 75
  • 1
  • 10
  • 3
    Have you tried to use enable agent for Windows OpenSSH (experimental): (default: disabled) in Keepass? Since VSCode supports only these https://code.visualstudio.com/docs/remote/troubleshooting#_installing-a-supported-ssh-client – Dauren Akilbekov Aug 25 '20 at 11:09
  • 2
    @DaurenAkilbekov That worked for me. Activated it in keepass (keeagent options tab) and it worked straight away. You may want to add that as an answer for future reference. – Dirk Sep 09 '20 at 11:15
  • 1
    Sorry, I wasnt looking into this issue for a while. First, I didnt notice that I had to select the host OS first (didnt see the prompt pop up). But after I did that, @DaurenAkilbekov 's solution also worked for me. I accepted the relevant answer as the solution. – fratajcz Sep 09 '20 at 15:05

1 Answers1

3

Go to Options > KeeAgent, then scroll down to Agent Mode Options and activate Enable agent for Windows OpenSSH (experimental): (default: disabled) Enable an SSH agent socket compatible with the built-in Windows 10 SSH client.

Dauren Akilbekov
  • 4,627
  • 2
  • 27
  • 32