0
I'd like ssh-agent
to be started when I start Cygwin, since I use ssh passthrough often.
I tried adding:
eval `ssh-agent.exe`
to my .bashrc
, but any time I use Alt-F2
to open a new terminal window, the .bashrc
is run and hence new ssh-agent
s are created which is undesirable and messes with the passthrough.
I then tried moving the eval command to .bash_profile
, but this too results in the same problem - I guess every new terminal window is considered a new login shell.
A third option is to use cygrunsrv
, but I just found about it and am not clear on how to use it for this specific purpose, and perhaps more importantly, how to pass on the SSH_AUTH_SOCK
and SSH_AGENT_PID
information from where the service is created to every new shell created.
Any suggestions on the best way to achieve this outcome - where a single ssh-agent is executed and waiting, and its information is immediately available to be used in any newly opened shell - is welcome.
Thanks for the answer and for the link. After looking at the various options, I went with the
keychain
solution, which turns out to be an awesome little program. – sundar - Reinstate Monica – 2016-09-25T10:09:01.733