jeanp413 / open-remote-ssh

VSCode Remote Development: Open any folder on a remote machine using SSH.
MIT License
309 stars 43 forks source link

hardcoded agentsock for windows breaks pageant compatibility #81

Closed JkktBkkt closed 1 year ago

JkktBkkt commented 1 year ago

Modern pageant versions are able to communicate with openssh as described in https://the.earth.li/~sgtatham/putty/0.78/htmldoc/Chapter9.html#pageant-cmdline-openssh

Perhaps a better approach would be to see if IdentityAgent is defined in config or SSH_AUTH_SOCK env variable is set and use those. If not and on windows, you can try using the hardcoded socket — although in my case it never worked even when using an older pageant version and a third-party "on-the-fly" key conversion for openssh client. ssh-add -l listed keys, while the extensions returned that none are available.

https://github.com/jeanp413/open-remote-ssh/blob/a98a858074d76788a335c4ced36361053816bef3/src/authResolver.ts#L100 For testing purposes I changed isWindows? to false? in my installation of the extension in %HOMEPATH%.vscode-oss\extensions\jeanp413.open-remote-ssh-0.0.33-universal\out\extension.js at pos 385477 and authenticated with no issues without exposing the key file anywhere.