PDA

View Full Version : xhost+ or something like that....


DaGuy
Sep 25, 2002, 09:07 PM
Don't shoot me! I swear I tried searching this forum but the darn thing is broken. Anyway, I'm running a remote X app (on a Linux server) via ssh and not getting the the graphics to display niether on XDarwin by itself nor by using OroborOSX.

Here's what I type from a stupid Winblows box running Cygwin:

ssh -X -l username remotesite.com

and I get it to display plots locally without any further setup.

How do I get this functionality in Jaguar?

Thanks in advanced!

:(

Charles Bouldin
Sep 25, 2002, 09:43 PM
I do exactly what you described:
ssh -X remotehostname -l username
and it works fine. You might look at
http://oroborosx.sourceforge.net/faq.html

That's where I looked to figure it out.

DaGuy
Sep 26, 2002, 12:13 AM
Well, good to know that it works for some folks. I checked that link and got a couple of ideas. Here's a sniplet of my .tcshrc

setenv DISPLAY :0.0
xhost

I thought that would do it. Alas, it still doesn't work.

Oh but how painful I can't believe Cygwin is doing what it should and OroborOSX or XDarwin is not. Maybe I'm the one who's messed up, if so any attempts to set me in the right path will be appreciated.

kvm_mkdb
Sep 26, 2002, 05:16 AM
Originally posted by DaGuy:
Well, good to know that it works for some folks. I checked that link and got a couple of ideas. Here's a sniplet of my .tcshrc

setenv DISPLAY :0.0
xhost



If you use ssh, you don't need to set the DISPLAY environment variable and you don't need to run xhost.

Setting the DISPLAY to :0.0 will override the tunnel that ssh creates with the -X flag.

DaGuy
Sep 26, 2002, 09:18 PM
Thanks for the information. I went in and got rid of those two lines.

Is there anything that you believe needs to be setup on the remote server side to identify my IP as a legitimate client?

Don't where else to look... HELP!

:(

kvm_mkdb
Sep 26, 2002, 11:19 PM
Originally posted by DaGuy:
Thanks for the information. I went in and got rid of those two lines.

Is there anything that you believe needs to be setup on the remote server side to identify my IP as a legitimate client?

Don't where else to look... HELP!

:(

It still doesn't work?

I'm sorry I don't understand your question about the remote not identifying your IP as legitimate...

DaGuy
Sep 27, 2002, 02:31 AM
It still doesn't work.

In desperation, I'm beginning to think that maybe the remote server has a list of recognized IPs for exporting the display. This is just speculation but I can't think of anything else.

One thing to mention is that I have to go through a gateway box before I get to the server that runs the app that I'm interested in displaying locally (my iMac). Here's a sort of illustration:

my iMac -------------> server 1 ------------------> server 2

I can't login directly to server 2, but that is not a problem for folks running Linux on laptops or Cygwin on winblows. It just doesn't work on my installation -major bummer...

Everyone else does:

ssh -l username server1.com

then once in server 1 they enter:

ssh -X -l username server2.com

and this does it for them. Any ideas??

Thanks.

kvm_mkdb
Sep 27, 2002, 03:28 AM
Originally posted by DaGuy:
Everyone else does:

ssh -l username server1.com

then once in server 1 they enter:

ssh -X -l username server2.com

and this does it for them. Any ideas??

Thanks.

The default config on OSX doesn't forward X (unlike most other distributions).

Either change /etc/ssh_config to "ForwardX11 yes" and then you can do like on the other machines, or type

ssh -X -l username server1.com

ssh -X -l username server2.com

so that the tunnel gets trough.

DaGuy
Sep 27, 2002, 11:22 PM
Thanks for the tips but it still didn' t work for me. Here's a snipplet of my ssh_config

ForwardAgent yes
ForwardX11 yes

I checked the remote servers and they both have forwarding on. Server 2 (see prior post) has the ForwardAgent turned off. I'm not sure what this does...

Where else can I look? I'm out of ideas.

In any event, thanks for your help.

:(

ego
Sep 29, 2002, 08:57 PM
Originally posted by DaGuy:

Where else can I look? I'm out of ideas.

In any event, thanks for your help.

:(

1. Does the forward works from the intermediate machine ?

2. What does "echo $DISPLAY" report on each machine ?

When using ssh to forward X11, $DISPLAY will typically look like "localhost:10" or somesuch, ie the X client (the app) directs the X drawing to a _local_ port. SSH tunnels this back to the real X server (the original machine (OS X)).

3. Just to check (apologies if this looks like a stupid question): is your X server launched ? Can you get local apps to display ?

DaGuy
Sep 30, 2002, 02:37 AM
Thanks for your help. Here are the answers to your questions:

1. I thought it did but on closer look now I have doubts.

/etc/ssh_config
ForwardAgent yes
ForwardX11 yes

but I checked the ssh dir noticed that:

/etc/ssh/ssh_config
ForwardAgent no
ForwardX11 no

2. echo $DISPLAY is not set on any of the remote servers. The echo command returns blank.

3. I love this question! I think I do have the Xserver started. Here's why:
- I launch OroborX and I get some nice NeXTish looking XTerm with the EYES on the upper right-hand corner. I can launch additional XTerms and utilities such as XCalc. So, I'm assuming I got this step done.

I will talk to sys admin of Server 1 and see if he can switch the ssh_config settings in the /etc/ssh dir. Perhaps that's the hang up. In any event., I'm still perplexed that some of my coworkers can login via Linux laptops and actually see the graphics comming from an app running on Server 2. Maybe they are BS-essing me...

Thanks!

ego
Oct 1, 2002, 09:01 PM
Originally posted by DaGuy:
Thanks for your help. Here are the answers to your questions:

1. I thought it did but on closer look now I have doubts.

/etc/ssh_config
ForwardAgent yes
ForwardX11 yes

but I checked the ssh dir noticed that:

/etc/ssh/ssh_config
ForwardAgent no
ForwardX11 no

2. echo $DISPLAY is not set on any of the remote servers. The echo command returns blank.

3. I love this question! I think I do have the Xserver started. Here's why:
- I launch OroborX and I get some nice NeXTish looking XTerm with the EYES on the upper right-hand corner. I can launch additional XTerms and utilities such as XCalc. So, I'm assuming I got this step done.

I will talk to sys admin of Server 1 and see if he can switch the ssh_config settings in the /etc/ssh dir. Perhaps that's the hang up. In any event., I'm still perplexed that some of my coworkers can login via Linux laptops and actually see the graphics comming from an app running on Server 2. Maybe they are BS-essing me...

Thanks!

I highly recommend the SSH book at O'Reilly to configure SSH. There are ways to override many default parameters, using user-specific config files (maybe ~/.sshconfig ?).

Do not bother trying the distant server until you get a non-null $DISPLAY on the intermediate server.

When I ssh into my FreeBSD box, $DISPLAY shows foo:10, where foo is the name of the machine (which isn't foo BTW). X clients (apps that use X) connect to this local "display" which is forwarded by ssh to the real display (the box I am on).

Sorry I can't help more. Good luck !

DaGuy
Oct 2, 2002, 12:39 AM
It finally worked!!

After talking to the Sys Adm it was clear that Server 1 (the middleman box) was ill-configured. Not just SSH but also the XWindows server. Proof of the this was that everything worked just fine after he gave me access to Server 2 via a different hop.

Well fellows, thanks for all your help and I did end up learning a few things in through the struggle, so don't feel you wasted your time. OSX rocks!


:)