You are not logged in.

#1 2006-04-13 18:47:23

aaronamd
Member
Registered: 2006-03-14
Posts: 22

X forwarding doesn't work

I would like to get x forwarding to work so I can play kolf at school, at the "far away machine" I have X11Forwarding yes in ssshd_config and the same on my local linux machine, no matter what I try I always get

xterm Xt error: Can't open display:
xterm:  DISPLAY is not set

no matter what program I use it's always the same thing, X11 is installed and functional on both ends, it's the new standard version 7. both machines are on a clean install too.

any ideals?

Offline

#2 2006-04-13 19:05:49

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: X forwarding doesn't work

There are two different ways of exporting the display and they depend on how the system was configured.

1)issue the command : export DISPLAY = localhost: 0.0   [as root]
then as a regular user issue: xhost

2) issue the command : xhost +localhost 0.0 [as user]

Offline

#3 2006-04-13 23:02:03

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: X forwarding doesn't work

You have enabled X11Forwarding on the server, that's step one. Step two is enabling ForwardX11 (or ForwardX11Trusted) for the client. The corresponding command line option is ssh -X (or ssh -Y). ForwardX11 should set the DISPLAY variable automatically.

ralvez wrote:

1)issue the command : export DISPLAY = localhost: 0.0   [as root]
then as a regular user issue: xhost

2) issue the command : xhost +localhost 0.0 [as user]

:shock:

Offline

#4 2006-04-13 23:06:51

aaronamd
Member
Registered: 2006-03-14
Posts: 22

Re: X forwarding doesn't work

still doesn't work, I still get:

xhost:  unable to open display ""

and I am using -X

Offline

#5 2006-04-13 23:28:29

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: X forwarding doesn't work

OK. If you are (1) using one of the commands I sent to you to export X and (2) on the machine you want to use as the host type ssh -X yourID@intendedserver.xyz then the only other thing I can think of is that there is a firewall on the intended server, preventing the icomming X connetions.

Offline

#6 2006-04-14 00:27:35

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: X forwarding doesn't work

You also tried ssh -Y? It would be helpful to see the exact commands you're using.

The X11 traffic is tunneled over the ssh connection. so it should not be a firewall problem.

Offline

#7 2006-04-14 17:38:16

aaronamd
Member
Registered: 2006-03-14
Posts: 22

Re: X forwarding doesn't work

I have also try'd -Y and both Y and X together, all to no avail, I'm starting to think that this actually is a firewall thing, there is an iptables firewall in place  on the end that is to be displaying the X applications... would it be wise to post iptables -L online?

Offline

#8 2006-04-14 22:25:37

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: X forwarding doesn't work

1) The xhost solution posted above is rubbish. Not only is it unsecure, but it is also wrong in this context and wrong in 2 other ways that I do not want to describe now.

2) If you want to forward X with ssh, there is not much to do, and I think you did it right:
a) Enable X11Forwarding yes in sshd_config on the server side (don't forget to restart sshd)
b) Start your ssh session with ssh -X $hostname. This enabled X forwarding for this one session. If it doesn't, you get an error message that tells you why. If $DISPLAY is not set and ther e is no error, then you either forgot -X (or -Y) or your $DISPLAY gets unset again after the login.

Offline

#9 2006-04-14 23:02:46

aaronamd
Member
Registered: 2006-03-14
Posts: 22

Re: X forwarding doesn't work

look, I dunno what else to say, I've done all this and nothing has changed, this worked fine on gentoo but has major problems in arch...

Offline

#10 2006-04-14 23:57:05

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: X forwarding doesn't work

Do you get any messages when you call ssh -X? Any errors? If not, please try ssh -X -v -v and post the output here.

Offline

#11 2007-04-19 03:17:50

bobbuck
Member
Registered: 2005-04-04
Posts: 4

Re: X forwarding doesn't work

I was not able to do X11 forwarding until I put

XAuthLocation /usr/bin/xauth

in /etc/ssh/sshd_config of the computer being ssh'd into.
I hope this helps.

Offline

#12 2007-04-30 13:28:06

sebcactus
Member
From: Germany
Registered: 2005-01-27
Posts: 277

Re: X forwarding doesn't work

You're great! I had the exact same problem, and it fixed it smile

Offline

#13 2007-11-21 15:29:53

Jacek Poplawski
Member
From: Poland
Registered: 2006-01-10
Posts: 736
Website

Re: X forwarding doesn't work

I just had the same problem, isn't a bug in Arch sshd configuration?

Offline

#14 2007-11-22 07:39:20

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: X forwarding doesn't work

That fixed it? But that's the default anyway. o.O


1000

Offline

#15 2007-11-22 09:25:49

Jacek Poplawski
Member
From: Poland
Registered: 2006-01-10
Posts: 736
Website

Re: X forwarding doesn't work

Yes, that fixed it, so it wasn't default, it must be a bug.

Offline

#16 2007-11-22 15:27:20

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: X forwarding doesn't work

Ah, right you are. Found the default location in /usr/sbin/sshd; it's /usr/X11R6/bin/xauth.

Hey, there's already a bug: http://bugs.archlinux.org/task/8729

Last edited by byte (2007-11-22 15:29:55)


1000

Offline

Board footer

Powered by FluxBB