X-Forwarding, this oughta work!

dgill

Registered
OK, this really should be working!

Host and client machines are running X11 beta 3
host is running Gimp installed via fink, it runs fine locally

I'm using a wireless router/switch, host wired, client wireless, and am using MAC address filtering for security.
No firewalls anywhere. (if this is not secure enough I'd love to know!)

I've set ForwardX11 to yes in ssh_config and re-started X11 on the host.
I log in from client with ssh -X user@macname.local or ssh -X macname.local

Entering /sw/bin/gimp-1.2 gives the error:
Gtk-WARNING **: cannot open display:

echo $DISPLAY returns:
DISPLAY: Undefined variable.


Any help would be greatly appreciated.
 
you've done everything fine except for the last thing. you have to target the display to yourself. so lets say you were on a compa and you sshed into compb with:
ssh -X user@compb
then once you were in you would type
set env 'DISPLAY=compa:10.0'
then you can run unix programs on compb and have the result come up on your screen. :)

good luck hope it helps.
 
So I tried setenv DISPLAY :0, even though apple's own FAQ suggests that ssh -X should do this for me.

NOW, entering /sw/bin/gimp-1.2 on the CLIENT causes gimp to run on the HOST not on the CLIENT. One step closer, eh?
 
No no, you don't have to fiddle the DISPLAY variable at all if you use ssh -X.

Maybe X11 forwarding is disabled on the *server*, please check that before you do anything else:
ssh -v -X user@macname.local

This should give you some info, also about if the server accepts X11 forwarding or not. If not, edit the sshd_config on the server and restart the sshd daemon there, this should work.
 
Thanks for the info. I've got X11 Forrwarding set to yes in ssh_config as apple's info suggests, and in sshd_config as you suggest.

Still getting the Gtk-WARNING **: cannot open display:
 
SUCCESS!

Not knowing how to re-start the sshd daemon, I tried logging out/in on the host machine, which didn't help. I then re-start the host machine, and voila! Gimp running on host, displaying on client.

So it looks like setting X11 Forwarding in sshd_config did the trick, where setting it in ssh_config did not. Does this sound correct to those who know? (As opposed to me, stumbling around in the dark?)

Thanks to everyone for suggestions and help.
 
Yes, that's correct. The client can oly suggest to the server about what it wants, but the server always has the freedom to prohibit anything it doesn't like.

In fact, to make use of X11 forwarding, the sshd server must allow that.

On the client side, setting ForwardX11=yes only means that X11 forwarding is active by default so that you don't have to explicitely specify the -X command line option anymore.

About restarting the sshd server, you can do that in the Sharing control panel. Just switch the remote login option off and on, this restarts it.
 
Back
Top