You are not logged in.

#1 2009-02-26 23:57:56

progrock
Member
Registered: 2008-07-19
Posts: 33

X Forwarding over SSH

Hi all,
  I've been trying to get this working for several days and finally figure that I need some help.  I have an Arch box that I use for backups and for compiling large C programs that I recently installed all the X stuff on so that I could get some graphical apps on my Windows box.  I thought the setup should be easy, with sshd_config:

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

and ssh_config

ForwardX11 yes

I use putty on the Windows machine with X11 forwarding enabled at localhost:10.0, with the Cygwin Xserver running.  When I try to run an X app, xclock for instance, I get:

Error: Can't open display: localhost:10.0

I'm not totally sure on the numbers after the 'localhost:', they're just my best guesses.
Any ideas?

Offline

#2 2009-02-27 00:09:36

userlander
Member
Registered: 2008-08-23
Posts: 413

Re: X Forwarding over SSH

ssh -l user <server> -Yv

Offline

#3 2009-02-27 00:12:42

progrock
Member
Registered: 2008-07-19
Posts: 33

Re: X Forwarding over SSH

$ ssh -l myusername 192.168.1.4 -Yv
OpenSSH_5.1p1, OpenSSL 0.9.8j 07 Jan 2009
debug1: Reading configuration data /home/Tim Davis/.ssh/config
debug1: Connecting to 192.168.1.4 [192.168.1.4] port 22.
debug1: Connection established.
debug1: identity file /home/Tim Davis/.ssh/identity type -1
debug1: identity file /home/Tim Davis/.ssh/id_rsa type -1
debug1: identity file /home/Tim Davis/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1
debug1: match: OpenSSH_5.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.1
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(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '192.168.1.4' is known and matches the RSA host key.
debug1: Found key in /home/Tim Davis/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/Tim Davis/.ssh/identity
debug1: Trying private key: /home/Tim Davis/.ssh/id_rsa
debug1: Trying private key: /home/Tim Davis/.ssh/id_dsa
debug1: Next authentication method: password
zephyr@192.168.1.4's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
Warning: No xauth data; using fake authentication data for X11 forwarding.
debug1: Requesting X11 forwarding with authentication spoofing.
Last login: Thu Feb 26 19:00:27 2009 from 192.168.1.100
$ xclock
Error: Can't open display: localhost:10.0
$

Offline

#4 2009-02-27 00:18:27

userlander
Member
Registered: 2008-08-23
Posts: 413

Re: X Forwarding over SSH

hmm, what does "echo $DISPLAY" say once you are logged in?

Offline

#5 2009-02-27 00:21:51

progrock
Member
Registered: 2008-07-19
Posts: 33

Re: X Forwarding over SSH

localhost:10.0

Thanks for the quick response.

Offline

#6 2009-02-27 00:23:54

userlander
Member
Registered: 2008-08-23
Posts: 413

Re: X Forwarding over SSH

I think it must be related to that xauth warning (though I could be totally wrong - never used cygwin big_smile). But try googling that and see if you come up with anything.

Last edited by userlander (2009-02-27 00:24:56)

Offline

#7 2009-02-27 00:59:06

kjon
Member
From: Temuco, Chile
Registered: 2008-04-16
Posts: 398

Re: X Forwarding over SSH

I prefer to use x11vnc. It looks simpler.

on your server: x11vnc -display :0 [-forever]
on your client: vncviewer, tightvnc, realvnc, etc.

You can always tunnelize with ssh -L from_port:destination:to_port ssh.server (without using X11forward)

Last edited by kjon (2009-02-27 00:59:35)


They say that if you play a Win cd backward you hear satanic messages. That's nothing! 'cause if you play it forwards, it installs windows.

Offline

#8 2009-02-27 03:06:08

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,544

Re: X Forwarding over SSH

Yeah, do try other X servers on the Windows PC. I myself like Xming.

Offline

#9 2009-02-27 11:53:53

artiom
Member
From: France
Registered: 2008-07-29
Posts: 111

Re: X Forwarding over SSH

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

tell you that your client will not be authenticated by your X server.
Try to open a local xterminal or equivalent (in cygwin) and type

xauth +

. This will authorize any client to connect your X server. Try again ssh and xclock.

Offline

#10 2013-01-30 17:53:21

archwade
Member
Registered: 2010-01-26
Posts: 14

Re: X Forwarding over SSH

artiom wrote:

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

tell you that your client will not be authenticated by your X server.
Try to open a local xterminal or equivalent (in cygwin) and type

xauth +

. This will authorize any client to connect your X server. Try again ssh and xclock.


Just a small note:  that should be

xhost +

Offline

#11 2013-01-30 18:32:31

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: X Forwarding over SSH

archwade, that's a 4 year old post. I am sure the op fixed it by now or stopped caring.

Please do not necrobump threads.

Our policy :: https://wiki.archlinux.org/index.php/Fo … Bumping.22

Closing...


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

Board footer

Powered by FluxBB