sshfs-win-manager icon indicating copy to clipboard operation
sshfs-win-manager copied to clipboard

[Feature request] Integrating with SSH key agent

Open RMerl opened this issue 4 years ago • 12 comments

Integration with an SSH key agent (Putty's or another one) would allow for more secure keyfile handling. The agent could take care of handling the password protection.

RMerl avatar Jun 20 '20 20:06 RMerl

Worth noting that there's an OpenSSH Authentication Agent service included in Windows 10, though it is disabled by default. But it's simple to enable and start it in the Services app, and it's guaranteed to be there in every Win10 installation. So if you add code to integrate with a key agent, please make sure the built-in Win10 OpenSSH agent is one of the ones you integrate with.

rmunn avatar Jul 09 '20 03:07 rmunn

Built-in Windows 10 SSH Agent uses a named pipe for communication instead of a socket as seen in Unix. I wasn't able to find any node package that implementa such communication method. In order to make this work I guess I will have to write my own client, and this will be a hard work, since I need to study the protocol and implement in JavaScript. I will also look up for other key management programs and see if they provide a better API.

evsar3 avatar Sep 03 '20 04:09 evsar3

What about Putty Agent?

Luckyvb avatar Nov 11 '20 15:11 Luckyvb

i recently started to look into it, no promises though - i also do not want to interfere with any plans that @evsar3 might have

lancetekk avatar Nov 19 '20 15:11 lancetekk

I am very sorry. While i thought it would be possible, it turns out that i oversaw an issue and i cant solve this right now. I will keep looking for a solution though.

I hope i can find a solution while digging through https://github.com/ymnk/jsch-agent-proxy/blob/master/jsch-agent-proxy-pageant/src/main/java/com/jcraft/jsch/agentproxy/connector/PageantConnector.java . If anyone has a hint, i would be thankful for a little pointer in the right direction.

lancetekk avatar Nov 23 '20 18:11 lancetekk

Built-in Windows 10 SSH Agent uses a named pipe for communication instead of a socket as seen in Unix. I wasn't able to find any node package that implementa such communication method.

https://stackoverflow.com/a/32172145 shows an example of using Windows named pipes: basically, you would use net.connect("\\\\.\\pipe\\INSERT_PIPE_NAME_HERE") if that example is correct. (The pipe is \\.\pipe\INSERT_PIPE_NAME_HERE but the backslashes have to be backslash-escaped, of course). I haven't tested this myself, but it looks like it's possible.

rmunn avatar Dec 05 '20 00:12 rmunn

+1 for this

venatiodecorus avatar Apr 04 '21 20:04 venatiodecorus

Oh yes, all my stuff uses my key loaded in Pageant. Windows Git client, WSL distros, PuTTY itself.... it'd be silly to save my passphrase in each and every SSH-related tool separately...

bviktor avatar Dec 26 '22 22:12 bviktor

this would be a great feature, I could maybe use 1password's agent then

itsTyrion avatar Aug 27 '23 19:08 itsTyrion

Oh yes, all my stuff uses my key loaded in Pageant. Windows Git client, WSL distros, PuTTY itself.... it'd be silly to save my passphrase in each and every SSH-related tool separately...

~~SSHFS-WIN has no support for the MS port of OpenSSH server and client, its using cygwin ports. Same with putty, pageant. Thats why they can share that ssh-agent.exe.~~

~~Git, GNUPG and WSL2 (AF_UNIX proxy) has support for the MS port. Thats why they can share that other ssh-agent.exe.~~

~~Its not silly that you have to type your passhprase for each ssh-agent..?~~

~~SSHFS-WIN doesnt even support the MS port so its expected that the manager for SSHFS-WIN doesnt either. Just use the cygwin agent for it all as all those clients you mention support it ?~~

Edit: --

ghost avatar Aug 28 '23 17:08 ghost

Yes, there’s no support atm, that’s precisely why this ticket exists. Thanks for your invaluable contribution to the topic.

bviktor avatar Aug 28 '23 17:08 bviktor

Yes, there’s no support atm, that’s precisely why this ticket exists. Thanks for your invaluable contribution to the topic

https://github.com/ansible/ansible/pull/77277#issuecomment-1072516081

ghost avatar Aug 28 '23 17:08 ghost