Can I use PLink and Pageant with Cygwin's ssh?
Solution 1
I also wrote a proxy between openssh and pageant, which I call ssh-pageant. It looks like pretty much the same approach as charade, but I hadn't heard of it. Well in case you have trouble, I thought I'd throw out ssh-pageant to try instead.
Solution 2
I came across charade a while ago, which replaces ssh-agent and proxies to Pageant. At the time I couldn't quite get it working, and haven't had the chance to play with it since, but it might be worth a try. If you have any luck please post back and let me know, it's been on my list of things to do for ages!
Solution 3
You are looking to integrate ssh-agent and pageant so that you have only one keystore. One way you can do this is use PuTTY as your terminal, keep your keys in pageant, enable agent forwarding, run Cygwin sshd and ssh to localhost. This will give you an environment where keys are served by pageant over the ssh connection with PuTTY -- no need to run ssh-agent.
It should be possible to do the same with Plink. Just use the -A option, and use the resulting SSH_AUTH_SOCK setting in your interactive Cygwin sessions. Disclaimer: I have not tried this.
Edit: I have now tried this; it works just fine. I created a shortcut to PLINK:
"C:\path\to\PLINK.EXE" -A -ssh -l yournamehere localhost "echo $SSH_AUTH_SOCK; while :; do sleep 86400; done"
Then, in a Cygwin terminal (I use PuTTYcyg of course):
export SSH_AUTH_SOCK=/tmp/ssh-crYQh24AMq/agent.3964
ssh-add -l
Seems to work great, but still requires a local sshd.
What would be really great is to have an openssh-compatible agent which communicates directly to the pageant keystore, but this won't happen unless someone writes such a beast. I looked into it many moons ago, and it seemed more trouble than it was worth given that this work-around is easy enough.
Solution 4
Could you go the other way and use puttycyg?
[http://code.google.com/p/puttycyg/]
That way you have putty as your cygwin terminal.
Related videos on Youtube
Jerph
it was on the news this mroing a developer in ar who had kill his three programs
Updated on September 17, 2022Comments
-
Jerph almost 2 years
I'm now using msysgit because of the GUI tools, which use Putty's Pageant and PLink utilities, but I use Cygwin as a general SSH terminal. I had been using ssh-agent on Cygwin, but that means I have to enter my SSH key passphrases for both SSH key managers. Is it possible to configure all my Unix-port tools (msys, git, cygwin, Ruby Net:SSH, etc.) to use PLink/Pageant instead of ssh-agent? It seems that's the kind of thing PLink was made for, but I can't find documentation on how.
-
Tobias Kienzler over 9 yearsfive years later: "PuttyAgent now supports openssh/cygwin/msys"
-
-
Jerph over 14 yearsI'm not sure what the consequences of using putty would be for my Cygwin scripts. I'm not really clear on where puttycyg inserts itself, I guess. I'll look into it - thanks!
-
Jerph over 14 yearsmmm, this not a bad idea at all. It's probably how I'll go. Thanks! And regarding your openssh-compatible agent, yes that's exactly what I was hoping plink could provide. It seems like it would be a pretty high value piece of code, since so much work goes into making software (like git) compatible with both openssh and plink. Why not just have a translation layer? Seems like "the Unix way" to do it. :)
-
Christopher Galpin about 14 yearsI can confirm it works. (As can @Nightfly below)
-
Alexander Pogrebnyak almost 14 yearsI would only add that before you build the package make sure that you have following packages in addition to default cygwin installation:
make
,gcc-core
,keychain
,psmisc
, and of courseopenssh
. This way if you follow very detailed instruction from the README file you will not get any errors -
Tobias Kienzler about 11 yearsHow does this link to Pageant? The question was about how to not use
ssh-agent
in addition to that.