[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

ssh and xauth in forwarding X clients



Sorry to trouble you all, I am trying to ssh into a server and then
run X clients.  After several days of investigation I am still
entirely unable to use any of my debian sid systems as the X server
that ssh forwards it's display to.

So, I have two laptops side by side.  One with redhat fedora core1 and
one with debian sid, and a server also running debian sid.  If I ssh
out of the redhat box to the server everything seems to work.
$DISPLAY is set and xauth has the correct information.  But when I do
the same from my debian laptop it doesn't work.  (I have three debian
sid machines set up right now, and all of them have this problem.)  I
have been through all the conf files, command line options, logs, etc;
and I can find no difference between the ssh set up on the two laptops
that could cause this.  After reading the bug reports for ssh I
thought it might have something to do with #237021 and the -Y option
but I have ssh 1:3.8.1p1-4 installed and ssh was changed back to using
authoritative X forwarding in -2.  I'll trying upgrading to -5 ...

Using -Y instead of -X makes no change difference and I can't see a
difference in the output using ssh -vv either.

It works if I set the $DISPLAY and xauth data by hand by passing the
ssh tunnel.

xauth list :0.0
ssh muggles
export DISPLAY="lawrence:0.0"
xauth add $DISPLAY $DATA-FROM-XAUTH

Honestly, I think that this is the problem:

1 cira@lawrence:/home/cira$ ssh muggles
Linux muggles 2.6.7-1-686 #1 Thu Jun 24 13:08:33 EDT 2004 i686 GNU/Linux
Last login: Tue Jul 13 09:56:46 2004 from 192.168.100.158
1 cira@muggles:/home/cira$ xauth list $DISPLAY
2 cira@muggles:/home/cira$ echo $DISPLAY
localhost:11.0
3 cira@muggles:/home/cira$ 

The xauth data for the tunnel is not being set!  But why?  Does it
work for other people?

In one of the man pages I read that if you create an executable script
in the server's .ssh directory and call it 'rc' that it will be passed
the xauth cookie so that you can set the data manually.  Well I tried
it and it is true, but even after setting the xauth data and $DISPLAY
from this rc script it _still_ didn't work.

Here is my very short script, it does it's job:

   read proto cookie
	xauth add $DISPLAY $proto $cookie


Usually I can figure stuff out on my own, but I've scanned the web,
read the documentation, searched the mailing lists, and beat myself up
for the last few days and haven't gotten anywhere.  My head hurts.  Of
course I've already tried the `-nolisten tcp` thing and the
X11Forwarding and so on in the ssh*_config files.  But any ideas right
now would be welcome.

Oh, any I have three of these debian boxes, they all exhibit this
behavior when acting as the client but work as a server.


Just for kicks here after follows a log:



1 cira@lawrence:/home/cira$ echo $DISPLAY :0.0 2
cira@lawrence:/home/cira$ xlogo    <== works

3 cira@lawrence:/home/cira$ ssh -vvv -Y muggles
OpenSSH_3.8.1p1 Debian 1:3.8.1p1-4, OpenSSL 0.9.7d 17 Mar 2004
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to muggles [192.168.100.107] port 22.
debug1: Connection established.
debug1: identity file /home/cira/.ssh/identity type -1
debug1: identity file /home/cira/.ssh/id_rsa type -1
debug3: Not a RSA1 key file /home/cira/.ssh/id_dsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /home/cira/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version OpenSSH_3.8.1p1 Debian 1:3.8.1p1-4
debug1: match: OpenSSH_3.8.1p1 Debian 1:3.8.1p1-4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1 Debian 1:3.8.1p1-4
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_init: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_init: found hmac-md5
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 128/256
debug2: bits set: 531/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /home/cira/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 11
debug3: check_host_in_hostfile: filename /home/cira/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 11
debug1: Host 'muggles' is known and matches the RSA host key.
debug1: Found key in /home/cira/.ssh/known_hosts:11
debug2: bits set: 526/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/cira/.ssh/identity ((nil))
debug2: key: /home/cira/.ssh/id_rsa ((nil))
debug2: key: /home/cira/.ssh/id_dsa (0x100564f0)
debug1: Authentications that can continue: publickey,keyboard-interactive
debug3: start over, passed a different list publickey,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/cira/.ssh/identity
debug3: no such identity: /home/cira/.ssh/identity
debug1: Trying private key: /home/cira/.ssh/id_rsa
debug3: no such identity: /home/cira/.ssh/id_rsa
debug1: Offering public key: /home/cira/.ssh/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-dss blen 433
debug2: input_userauth_pk_ok: fp 97:8d:88:20:ec:75:37:e3:e1:e9:da:d4:09:60:9b:ec
debug3: sign_and_send_pubkey
debug1: read PEM private key done: type DSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Entering interactive session.
debug2: callback start
debug2: ssh_session2_setup: id 0
debug2: channel 0: request pty-req
debug3: tty_make_modes: ospeed 38400
debug3: tty_make_modes: ispeed 38400
debug3: tty_make_modes: 1 3
debug3: tty_make_modes: 2 28
debug3: tty_make_modes: 3 0
debug3: tty_make_modes: 4 0
debug3: tty_make_modes: 5 4
debug3: tty_make_modes: 6 0
debug3: tty_make_modes: 7 0
debug3: tty_make_modes: 8 17
debug3: tty_make_modes: 9 19
debug3: tty_make_modes: 10 26
debug3: tty_make_modes: 12 18
debug3: tty_make_modes: 13 23
debug3: tty_make_modes: 14 22
debug3: tty_make_modes: 18 21
debug3: tty_make_modes: 30 0
debug3: tty_make_modes: 31 0
debug3: tty_make_modes: 32 0
debug3: tty_make_modes: 33 0
debug3: tty_make_modes: 34 0
debug3: tty_make_modes: 35 0
debug3: tty_make_modes: 36 1
debug3: tty_make_modes: 37 0
debug3: tty_make_modes: 38 1
debug3: tty_make_modes: 39 0
debug3: tty_make_modes: 40 0
debug3: tty_make_modes: 41 0
debug3: tty_make_modes: 50 1
debug3: tty_make_modes: 51 1
debug3: tty_make_modes: 52 0
debug3: tty_make_modes: 53 0
debug3: tty_make_modes: 54 1
debug3: tty_make_modes: 55 1
debug3: tty_make_modes: 56 0
debug3: tty_make_modes: 57 0
debug3: tty_make_modes: 58 0
debug3: tty_make_modes: 59 1
debug3: tty_make_modes: 60 1
debug3: tty_make_modes: 61 1
debug3: tty_make_modes: 62 0
debug3: tty_make_modes: 70 1
debug3: tty_make_modes: 71 0
debug3: tty_make_modes: 72 0
debug3: tty_make_modes: 73 0
debug3: tty_make_modes: 74 0
debug3: tty_make_modes: 75 0
debug3: tty_make_modes: 90 1
debug3: tty_make_modes: 91 1
debug3: tty_make_modes: 92 0
debug3: tty_make_modes: 93 0
debug2: x11_get_proto: /usr/bin/X11/xauth  list :0.0 . 2>/dev/null
debug1: Requesting X11 forwarding with authentication spoofing.
debug2: channel 0: request x11-req
debug2: channel 0: request shell
debug2: fd 3 setting TCP_NODELAY
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 131072
Linux muggles 2.6.7-1-686 #1 Thu Jun 24 13:08:33 EDT 2004 i686 GNU/Linux

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

Last login: Tue Jul 13 10:04:25 2004 from 192.168.100.158
1 cira@muggles:/home/cira$ echo $DISPLAY
localhost:12.0
2 cira@muggles:/home/cira$ xauth list $DISPLAY
3 cira@muggles:/home/cira$ xlogo
debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
debug1: client_request_x11: request from 127.0.0.1 1082
debug2: fd 7 setting O_NONBLOCK
debug2: fd 7 is O_NONBLOCK
debug1: channel 1: new [x11]
debug1: confirm x11
debug2: X11 auth data does not match fake data.
X11 connection rejected because of wrong authentication.
debug2: X11 rejected 1 i0/o0
debug2: channel 1: read failed
debug2: channel 1: close_read
debug2: channel 1: input open -> drain
debug2: channel 1: ibuf empty
debug2: channel 1: send eof
debug2: channel 1: input drain -> closed
debug2: channel 1: write failed
debug2: channel 1: close_write
debug2: channel 1: output open -> closed
debug2: X11 closed 1 i3/o3
debug2: channel 1: send close
debug2: channel 1: rcvd close
debug2: channel 1: is dead
debug2: channel 1: garbage collecting
debug1: channel 1: free: x11, nchannels 2
debug3: channel 1: status: The following connections are open:
  #0 client-session (t4 r0 i0/0 o0/0 fd 4/5)
  #1 x11 (t7 r3 i3/0 o3/0 fd 7/7)

debug3: channel 1: close_fds r 7 w 7 e -1
X connection to localhost:12.0 broken (explicit kill or server shutdown).
4 cira@muggles:/home/cira$ exit
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
logout
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
debug2: channel 0: rcvd close
debug2: channel 0: close_read
debug2: channel 0: input open -> closed
debug3: channel 0: will not send data after close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i3/0 o3/0 fd -1/-1)

debug3: channel 0: close_fds r -1 w -1 e 6
Connection to muggles closed.
debug1: Transferred: stdin 0, stdout 0, stderr 31 bytes in 46.7 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.7
debug1: Exit status 1
4 cira@lawrence:/home/cira$ 

Sam George

--
   .''`.          /\/'`\         debian@spishack.com
  : :' :        .::/:::::..    .  irc://fslc.usu.edu/#cira
  `. `'    ) .//::(:###( )::.._/^  gps:41°45'N 111°49'W
    `- ..:@://"  ,|)   _/.        gpg:1024D/A7AAF777



Reply to: