Detach ssh from bash in Cygwin?

From: Duncan Murdoch (google_at_murdoch-sutherland.com)
Date: 03/25/04


Date: 25 Mar 2004 11:44:23 -0800

I'm using OpenSSH in Cygwin under WinXP. I can set up POP3 port
forwarding (for Forte Agent) from within the bash shell in Cygwin, but
when I close the bash window, it shuts down the ssh process that is
doing the forwarding for me.

This doesn't happen with ssh-agent; that process keeps running after
the bash window closes.

Is there a way to detach the ssh process from the shell so I can close
the window without killing it?

I think I've tried all combinations of putting an & at the end of the
ssh command line, and putting a -f option in it, so far with no luck.

For example, here's a command line I've tried:

ssh -N -f -L 2110:mailhost.com:110 dmurdoch@mailhost.com &

This installs the tunneling and things work fine until I try to close
the window with "exit"; then the window won't close until I click on
the frame to close it, at which time Windows says "Windows cannot
close this program ....", and if I tell it to "End now", the ssh
process goes away too.

Duncan Murdoch



Relevant Pages

  • Re: Detach ssh from bash in Cygwin?
    ... > when I close the bash window, it shuts down the ssh process that is ... > the bash window closes. ... > Is there a way to detach the ssh process from the shell so I can close ...
    (comp.security.ssh)
  • Re: Old 486 computer & external CD reader advice needed
    ... looks like it is used to connect as an X client. ... However it does contain bash (I ... and open the bash window without starting X. ... in 'X -query host' mode for a full desktop XDCMP login. ...
    (Fedora)
  • Re: bash on solaris: "export LINES=27" doesnt change LINES
    ... >> I am not changing the window size within those set of commands. ... causes bash to check the window size after each command to see if LINES ... shopt -u checkwinsize ...
    (comp.unix.solaris)
  • Re: bash on solaris: "export LINES=27" doesnt change LINES
    ... >> I am not changing the window size within those set of commands. ... causes bash to check the window size after each command to see if LINES ... shopt -u checkwinsize ...
    (comp.unix.shell)
  • Re: Need Windows under Linux?
    ... It's a standard GNU toolchain with the standard ... bash shell and toolchain. ... I think the posix layer ... Never tried running X Window though, ...
    (borland.public.delphi.non-technical)