Charles Curley wrote: > 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@xxxxxxxxxxxxxx> 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 > > That would work fine if you wanted to connect from host 2 to host 1, and have the program displayed on host 2. But the OP wanted to connect to machine 2 from machine 1, and have the program display on machine 1, not machine 2. So using the -Y (or -X option) would have the program displayed on the wrong machine. In this case, you do not want sshd to set DISPLAY for you. You should not need to mess with xhosts as long as you are logged in as the same user. But if you run into refused connection problems, it is good to know about that option. (As long as you remember that it has to be run in the X secession you want to connect to.) Mikkel -- Do not meddle in the affairs of dragons, for thou art crunchy and taste good with Ketchup!