Howto: starting ssh-agent/keychain and launching remote apps

Igor Pechtchanski
Fri Apr 16 15:49:00 GMT 2004

On Fri, 16 Apr 2004, Peter Valdemar Mørch wrote:

> Hi there,
> I use xterms on remote machines, and really don't want to have to start
> a cygwin prompt every time. With the setup shown here, you can create a
> windows shortcut, that will ssh to and launch an app on a remote machine
> without any cygwin prompt and without any annoying dos boxes hanging
> around in the taskbar.
> If anybody has gotten this to work in a simpler way, I'd love to hear
> about it. But in order to source the .keychain/<mach>-sh and then run
> ssh I have to run bash. Running bash gives a nasty dos box, unless I use
> 7 lines of Visual Basic. Simpler suggestions? It has taken me a while to
> get it to work, and so I thought I'd post the howto here.

What's wrong with using "run"?  I.e., something like
C:\cygwin\usr\X11R6\bin\run.exe /bin/bash.exe --login -c "ssh -f -Y -A remotehost xterm"

BTW, a couple of caveats: you'll either need xterm to be in the PATH on
the remote host or specify the path to xterm explicitly; DISPLAY has to be
set properly; and you might want to redirect the output of ssh to a log
somewhere, just so you know when something goes wrong.  Here's what I have
that's worked for me just now:

C:\cygwin\usr\X11R6\bin\run.exe /bin/bash --login -c "DISPLAY=localhost:0.0 ssh -f -Y -A user@remotehost /usr/X11R6/bin/xterm >/tmp/invoke_xterm.$$.log 2>&1"

> I'd like to write the documentation for this too (e.g. in "Displaying
> Remote Clients" in the UG), but would like first to hear if this is
> useful to anybody. If so, I'll write the docbook documentation and
> submit a more complete patch.
> Until then, here is a patch to startxwin.bat. I want the ssh-agent
> (keychain) opened when the x-server is started, so I'm good to go
> immediately.
> Also, it describes in a README manner how to get a desktop icon working
> effortlessly.
> Here is the patch.
> [snip]

      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

More information about the Cygwin-xfree mailing list