Subject: Re: SSH session terminates with Ctl+C
From: Jeff Nokes <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Fri, 8 Aug 2003 09:14:07 -0700 (PDT)

Ehud,
I just wanted to let you know I've narrowed down the cause of the ssh session
dying on a Ctl+C (at least I think I have).

As well as this ssh session issue that this email thread has been addressing,
I was also trying to find a way to get rid of a waring I kept receiving
whenever I tried to use 'ssh -X ...' to forward X packets back to my W2K
workstation:

  Warning: No xauth data; using fake authentication data for X11 forwarding.

In my research on how to get rid of this, I tried various combinations of
settings for my Cygwin bash shell (using CMD.exe), involving changing my local
DISPLAY value, adding/subtracting items from my .ssh/config file, etc.  I
found that the only time I was able to get a DISPLAY setting on my remote host
(using ssh -X) was when I had a DISPLAY setting set in my own cygwin
environment, 'ForwardX11 yes' in my .ssh/config, and/or used 'ssh -X', prior
to creating the ssh session.  But any time I was successful in setting the
remote DISPLAY setting, I always received that warning above.  Interestingly
enough, I played around with a few scenarios regarding connecting to my remote
Linux hosts to forward X packets, and I found that any time I received that
warning above was when my ssh session would terminate with a Ctl+C.  If I did
not recieve that xauth (meaning I had no DISPLAY set on the remote host), then
the Ctl+C would not terminate my ssh session.

Now, this only behaves like this when using the CMD.exe for running bash. 
When I use the rxvt.exe terminal (which I've since switched to), a Ctl+C would
not terminate my ssh session, even if I received that xauth warning.  Also,
the behavior of when I would see the xauth warning in the rxvt terminal was
identical to that of the bash shell using cmd.exe.

Not sure if any of this helps (or if anyone even cares), but I thought I would
mention it.  Now, all I have to do is figure out how to not have that xauth
warning show up, and still get my remote host DISPLAY set automatically via my
ssh session.
- Jeff

--- Ehud Karni <[email-masked]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Tue, 5 Aug 2003 16:17:24 -0700 (PDT), Jeff Nokes <[email-masked]>
> wrote:
> >
> > Here's my ssh -v output:
>   [snip]
> > debug1: channel 0: request x11-req
> > debug1: channel 0: request shell
> > debug1: channel 0: open confirm rwindow 0 rmax 32768
> > [jnokes@row-cm jnokes]$ debug1: channel_free: channel 0: client-session,
> > nchannels 1
> > Killed by signal 2.
> 
> This line indicate kill on the local machine (Cygwin), see below.
> 
> > debug1: Calling cleanup 0x4138d0(0x0)
> > debug1: Calling cleanup 0x41b2a0(0x0)
> 
> 
> > jnokes@D-SJC-JNOKES ~
> > $
> > *********************************************
> >
> >
> > Also,
> > I have a RH 7.2 box that I ssh to as well, and the same behavior occurs
> there
> > as well.  Here is the output of that if you are interested:
>   [snip]
> > debug1: channel 0: request shell
> > debug1: channel 0: open confirm rwindow 0 rmax 32768
> > Last login: Fri Jul 25 17:57:35 2003 from d-sjc-jnokes.corp.ebay.com
> > [jnokes@row-dev-02 jnokes]$ debug1: channel_free: channel 0:
> client-session,
> > nchannels 1
> > Killed by signal 2.
> 
> Same as above (local kill, i.e. Cygwin)
> 
> > debug1: Calling cleanup 0x4138d0(0x0)
> > debug1: Calling cleanup 0x41b2a0(0x0)
> 
> 
> To check your report I did 2 ssh sessions. In the first I killed the
> remote (GNU/Linux sshd) the result is:
> 
> debug1: channel_free: channel 0: port listener, nchannels 4
> debug1: channel_free: channel 1: port listener, nchannels 3
> debug1: channel_free: channel 2: port listener, nchannels 2
> debug1: channel_free: channel 3: client-session, nchannels 1
> Connection to 192.214.178.73 closed by remote host.
> Connection to 192.214.178.73 closed.
> debug1: Transferred: stdin 0, stdout 0, stderr 91 bytes in 34.8 seconds
> debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 2.6
> debug1: Exit status -1
> debug1: compress outgoing: raw data 1271, compressed 942, factor 0.74
> debug1: compress incoming: raw data 1987, compressed 939, factor 0.47
> 
> In the second I killed the local ssh (by `kill -2' from another bash):
> 
> debug1: channel_free: channel 0: port listener, nchannels 4
> debug1: channel_free: channel 1: port listener, nchannels 3
> debug1: channel_free: channel 2: port listener, nchannels 2
> debug1: channel_free: channel 3: client-session, nchannels 1
> Killed by signal 2.
> debug1: Calling cleanup 0x4138d0(0x0)
> debug1: Calling cleanup 0x41b2a0(0x0)
> debug1: compress outgoing: raw data 931, compressed 769, factor 0.83
> debug1: compress incoming: raw data 1272, compressed 585, factor 0.46
> 
> Signal 2 is SIGINT (the one created by the INTR in stty, usually ^C),
> so it really seems that ^C is somehow caught by the local ssh.
> 
> I repeat that I can not reproduce this bug under XP pro, neither with
> Cygwin console nor with rxvt window (cygwin1.dll, ssh same as yours).
> 
> A half apology to readers of my previous mail. As you can see I use
> compression with ssh (I do it automatically - with a config file) so
> I omitted (in my mind) the possibility of not using it.
> 
> Ehud.
> 
> 
> - --
>  Ehud Karni           Tel: +972-3-7966-561  /"\
>  Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
>  Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
>  http://www.mvs.co.il  FAX:  1-815-5509341  / \
>  mailto:[email-masked]                  Better  Safe  Than  Sorry
> -----BEGIN PGP SIGNATURE-----
> Comment: use http://www.keyserver.net/ to get my key (and others)
> 
> iD8DBQE/MLGALFvTvpjqOY0RAsQXAJ9XjLJC0eDmfR+/CPwa3PbRCdVVyQCfQ1A5
> nCO50CwnGD7yBQOgTfllLSw=
> =SbNA
> -----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/