Cannot Get X11 Forwarding to Work via SSH

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am having problems getting X Forwarding to work via an SSH tunnel
from my Mandrake 10.1 Linux box to my Windows XP Pro box.

I have installed sshd and updated sshd.conf in /etc/ssh/ so that:
X11Forwarding yes
X11DisplayOffset 10

The X server is started on the linux box.

I have installed Cygwin/X on the XP box, following the directions
there to get X11 running and openSSH running on the XP machine. I can
successfully ssh to the linux machine, and I connect using the -X ssh

BTW, Mandrake was installed with the 'paranoid' option and the
firewall is running. Not sure if that makes a difference as I
understand X11 uses ports on localhost address.

Once connection is made (I did start X on the XP box first), I try
running an X program (such as xterm or kedit) and get an error message
like "Unable to connecto to X server".

I did notice that on the linux machine when I ssh, there is no DISPLAY
env var set. I have tried setting it manually to localhost:10.0 and to
machinename:10.0 but neither works. I am thinking this is part of the
problem. Shouldn't this variable be set automatically?

Any help or suggestions would be greatly appreciated. I am fairly new
to Linux and have not been able to find any answers though Googling on
X Forwarding SSH that solve my problem.


Re: Cannot Get X11 Forwarding to Work via SSH (Brian Boorman) wrote:
Quoted text here. Click to load it

Two things.
1) Ensure that you have xauth installed.  This is what sets up the
DISPLAY variable for remote logins.
2) You need to use the -X flag with ssh to have the DISPLAY variable
transported across the connection.  If you don't use -X, DISPLAY is not

Matthew Poole                   Auckland, New Zealand
"Veni, vidi, velcro...
                     I came, I saw, I stuck around"

My real e-mail is mattATp00leDOTnet

Re: Cannot Get X11 Forwarding to Work via SSH

  Richard Silverman

Site Timeline