How to open an application in a remote x session

Charles Curley charlescurley at charlescurley.com
Fri Nov 10 04:51:33 UTC 2006


On Thu, Nov 09, 2006 at 10:23:33AM -0600, Mikkel L. Ellertson wrote:
> Dan Track wrote:
> > On 11/9/06, Manuel Arostegui Ramirez <manuel at todo-linux.com> wrote:

> > Thanks for the reply. Sorry I guess I didn't make myself clear, lets
> > say we have teh following:
> > 
> > host1                                 host2
> > 
> > I want the user on host2 to ssh to host1, then run say gedit which
> > will opne up on the xdisplay the user has running on host1. Do you
> > know how to do this?
> > 
> > Thanks
> > Dan
> > 
> After you ssh to host1, you will need to ether set DISPLAY. Or you
> will need to use the -display option when you start the program.
> 
> export DISPLAY=:0

> 
> or
> 
> xterm -display :0 &
> 
> This will only work for when you are logged into host1 as the user
> that is logged into X on that machine, or if you have disabled X
> security on host1. (See the xhost command - it has to be run in X on
> host1.)

Ah, no.

If you ssh in to the remote host with the -Y option, all the mucking
with xhosts is moot, and DISPLAY is handled for you. ssh into a remote
box with -Y and run "echo $DISPLAY". You will see that you are getting
a display on the local machine, but it is display number ten (or some
such). That display is tunneled through SSH to your local machine. 

Normally X uses a clear protocol, meaning anyone can snoop the
data. Furthermore, security is bad enough in native X without
disabling it entirely. Tunneling X through SSH handles the problem
very nicely. Just use the -Y option:

ssh -Y foo

-- 

Charles Curley                  /"\    ASCII Ribbon Campaign
Looking for fine software       \ /    Respect for open standards
and/or writing?                  X     No HTML/RTF in email
http://www.charlescurley.com    / \    No M$ Word docs in email

Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20061109/4f8ed730/attachment-0002.bin 


More information about the users mailing list