Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 May 2002 09:10:08 -0700 (PDT)
From:      John Polstra <jdp@polstra.com>
To:        stable@freebsd.org
Subject:   ssh + X11 forwarding = a hung ssh process
Message-ID:  <XFMail.20020530091008.jdp@polstra.com>

next in thread | raw e-mail | index | archive | help
I've been seeing a strange problem involving ssh's X11 forwarding
on FreeBSD-stable systems.  Here's the scenario.  From my desktop
machine I use ssh to run an X11 application on a different machine.
The application appears on my desktop's screen as expected, and it
works fine.  Now I exit the application.  But the ssh command does not
exit; it remains hung until I kill it.

For example: my desktop machine is "strings" and the other machine
is "thin".  I start an xterm like this:

    strings$ ssh thin xterm

Now I exit the xterm by typing "logout" into it.  The xterm goes away,
but the ssh command does not exit.  It just sits there until I kill
it.

The desktop machine (strings) is running 4.5-stable from around 2
Feb. 2002.  It has XFree86-4.1.0_10 installed from ports.  The other
machine (thin) is running 4.6-RC1 from 18 May 2002.

Is anybody else seeing this problem?  I'll append the "ssh -v"
output below.

John

strings$ ssh -v thin xterm
OpenSSH_2.9 FreeBSD localisations 20011202, SSH protocols 1.5/2.0, OpenSSL 0x0090601f
debug1: Reading configuration data /home/jdp/.ssh/config
debug1: Applying options for thin
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug1: restore_uid
debug1: ssh_connect: getuid 1001 geteuid 1001 anon 1
debug1: Connecting to thin.polstra.com [206.213.73.5] port 22.
debug1: temporarily_use_uid: 1001/1001 (e=1001)
debug1: restore_uid
debug1: temporarily_use_uid: 1001/1001 (e=1001)
debug1: restore_uid
debug1: Connection established.
debug1: identity file /home/jdp/.ssh/identity type 0
debug1: identity file /home/jdp/.ssh/id_rsa type 1
debug1: identity file /home/jdp/.ssh/id_dsa type 2
debug1: Remote protocol version 1.99, remote software version OpenSSH_2.9 FreeBSD
localisations 20020307
debug1: match: OpenSSH_2.9 FreeBSD localisations 20020307 pat ^OpenSSH
Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_2.9 FreeBSD localisations 20011202
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: dh_gen_key: priv key bits set: 139/256
debug1: bits set: 1036/2049
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'thin.polstra.com' is known and matches the DSA host key.
debug1: Found key in /home/jdp/.ssh/known_hosts2:3
debug1: bits set: 1017/2049
debug1: len 55 datafellows 0
debug1: ssh_dss_verify: signature correct
debug1: kex_derive_keys
debug1: newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: waiting for SSH2_MSG_NEWKEYS
debug1: newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: done: ssh_kex2.
debug1: send SSH2_MSG_SERVICE_REQUEST
debug1: service_accept: ssh-userauth
debug1: got SSH2_MSG_SERVICE_ACCEPT
debug1: authentications that can continue: publickey,password,keyboard-interactive
debug1: next auth method to try is publickey
debug1: userauth_pubkey_agent: testing agent key /home/jdp/.ssh/id_dsa
debug1: input_userauth_pk_ok: pkalg ssh-dss blen 433 lastkey 0x808b370 hint -1
debug1: ssh-userauth2 successful: method publickey
debug1: channel 0: new [client-session]
debug1: channel_new: 0
debug1: send channel open 0
debug1: Entering interactive session.
debug1: client_init id 0 arg 0
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Requesting authentication agent forwarding.
debug1: Sending command: xterm
debug1: channel 0: open confirm rwindow 0 rmax 16384
debug1: client_input_channel_open: ctype x11 rchan 3 win 4096 max 2048
debug1: client_request_x11: request from 206.213.73.5 1094
debug1: fd 7 setting O_NONBLOCK
debug1: fd 7 IS O_NONBLOCK
debug1: channel 1: new [x11]
debug1: confirm x11

[At this point the xterm is on the screen and I can use it.  Now I quit
the xterm by typing "logout".]

debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: rcvd eof
debug1: channel 0: output open -> drain
debug1: channel 0: rcvd close
debug1: channel 0: input open -> closed
debug1: channel 0: close_read
debug1: channel 1: rcvd eof
debug1: channel 1: output open -> drain
debug1: channel 0: obuf empty
debug1: channel 0: output drain -> closed
debug1: channel 0: close_write
debug1: channel 0: send close
debug1: channel 0: is dead
debug1: channel_free: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i8/0 o128/0 fd -1/-1)
  #1 x11 (t4 r3 i1/0 o32/0 fd 7/7)

debug1: channel_free: channel 0: dettaching channel user
debug1: channel 1: obuf empty
debug1: channel 1: output drain -> closed
debug1: channel 1: close_write
debug1: channel 1: read<=0 rfd 7 len 0
debug1: channel 1: read failed
debug1: channel 1: input open -> drain
debug1: channel 1: close_read
debug1: channel 1: input: no drain shortcut
debug1: channel 1: ibuf empty
debug1: channel 1: input drain -> closed
debug1: channel 1: send eof
debug1: channel 1: send close
debug1: channel 1: rcvd close
debug1: channel 1: is dead
debug1: channel_free: channel 1: status: The following connections are open:
  #1 x11 (t4 r3 i8/0 o128/0 fd 7/7)

[Now the xterm window is gone from my screen.  But the ssh process remains
until I kill it manually.]

^CKilled by signal 2.
debug1: Calling cleanup 0x805f450(0x0)
debug1: Calling cleanup 0x805971c(0x0)
strings$

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020530091008.jdp>