Re: Attempting to run remote X app

From: Ben Measures (saint_abroadremove_at_removehotmail.com)
Date: 01/22/04


Date: Thu, 22 Jan 2004 05:04:36 +0000

Joel Konkle-Parker wrote:
> I'm attempting to ssh into a central server and run an X app, with the
> app displaying back on my display.
>
> I've ssh'd into the server (where username@server is replaced with the
> actual values):
>
> --
> $ ssh username@server
> username@server's password:
>
> Terminal set to xterm
> Wed Jan 21 15:37:14 CST 2004
>
> --
>
> Set the display (where 'ip_address' is my IP from /sbin/ifconfig):
>
> --
>
>>DISPLAY=ip_address:0; export DISPLAY
>>echo $DISPLAY
>
> ip_address:0
>
> --
>
> And tried to run the app (where ip_address is my IP, like above):
>
> --
>
>>xclock
>
> Error: Can't open display: ip_address:0
>
> --
>
> I'm not really sure what to try next... Any ideas?
>
> Thanks in advance.
>
>

Three things:
1.) Make sure the ssh server is forwarding X connections:
/etc/ssh/sshd_config
X11Forwarding yes

2.) Make sure the ssh client is forwarding X connections:
/etc/ssh/ssh_config
Host *
    ForwardX11 yes

3.) Make sure you run the ssh client from an xterm (inside of XFree86)
'man ssh'
X11 and TCP forwarding
If the ForwardX11 variable is set to ``yes'' (or, see the description of
the -X and -x options described later) and the user is using X11 (the
DISPLAY environment variable is set), the connection to the X11 display
is automatically forwarded to the remote side in such a way that any X11
programs started from the shell (or command) will go through the
encrypted channel, and the connection to the real X server will be made
from the local machine. The user should not manually set DISPLAY.
Forwarding of X11 connections can be configured on the command line or
in configuration files.

Notice that you should not manually set DISPLAY.

-- 
Ben M.
----------------
What are Software Patents for?
To protect the small enterprise from bigger companies.
What do Software Patents do?
In its current form, they protect only companies with
big legal departments as they:
a.) Patent everything no matter how general
b.) Sue everybody. Even if the patent can be argued
	invalid, small companies can ill-afford	the
	typical $500k cost of a law-suit (not to mention
	years of harassment).
Don't let them take away your right to program
whatever you like. Make a stand on Software Patents
before its too late.
Read about the ongoing battle at http://swpat.ffii.org/
----------------


Relevant Pages

  • Re: Partial SNAFUs - X11Forwarding etc.
    ... to the base server machine via SSH, or it it also supposed to protect ... back "up the line" to the client machine? ... the ssh server host is compromised or otherwise untrustworthy, ... refrain from running the program via ssh X11 forwarding - there's no ...
    (comp.security.ssh)
  • Re: [SLE] export DISPLAY and xhost +
    ... >>impression that remote X using DISPLAY travels over ssh just because you ... > X11 and TCP forwarding ... the connection to the X11 display is auto­ ... and the connection to the real X server will be made from the ...
    (SuSE)
  • Re: probleme mit ssh
    ... waehrend das entfernte System der Server ist. ... Bei X11 ist alles andersherum, da ist das entfernte System der Client ... und dein lokales Display der Server. ... DArum brauchsts bei SSH ...
    (de.comp.os.unix.networking.misc)
  • Re: Suggestions for a square font?
    ... > ssh -X creates a tunnel from distant_computer to your real X server at ... > the tunneled X display, connecting directly to the X ... Let's say that the first line was for ssh users and the second ... connect through ssh and play a curses game. ...
    (rec.games.roguelike.development)
  • Re: probleme mit ssh
    ... waehrend das entfernte System der Server ist. ... und dein lokales Display der Server. ... DArum brauchsts bei SSH ... SSH hat das fuer X11 aber bereits ...
    (de.comp.os.unix.networking.misc)