Can't get X11 to forward over SSH, what's wrong...

michaelsanford

Translator, Web Developer
...with my configuration ?

I've followed btoneill's great FAQ I believe to the letter and have done the following (only those changed from defaults are indicated):

/etc/sshd_config - on the server
LoginGraceTime 20
PermitRootLogin no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
(the last two are unchanged from the defaults, should I have changed them?)

/etc/ssh_config - on the client
Host *
ForwardAgent yes
ForwardX11 yes

Once logged in
[amras@nimbus ~]% setenv DISPLAY :0:0
[amras@nimbus ~]% pan
_X11TransSocketINETConnect: can't get service for 0:0

(pan:22675): Gtk-WARNING **: cannot open display:


So what'd I do wrong ? I am connecting with "ssh -X hostname" and I have X11.app open both on the client and on the server.
 
You're not supposed to set the DISPLAY on the remote server when you're using ssh. ssh sets it for you automatically. Type "echo $DISPLAY" and you should see something like "localhost:10.0", which is the pseudo entry that ssh uses to tunnel X to your local box.

Brian
 
btoneill said:
You're not supposed to set the DISPLAY on the remote server when you're using ssh. ssh sets it for you automatically. Type "echo $DISPLAY" and you should see something like "localhost:10.0", which is the pseudo entry that ssh uses to tunnel X to your local box.

Brian

Oops sorry that's the clincher and I left it out...DISPLAY isn't set :
[Homsar:~] amras% ssh -X nimbus

Welcome to Nimbus

amras - console Apr 13 13:32 04:35
amras + ttyp1 Apr 13 18:07 . (fe80::20a:27ff:f)
No Sockets found in /tmp/uscreens/S-amras.

[amras@nimbus ~]% print $DISPLAY
tcsh: DISPLAY: Undefined variable.


nimbus is the one above I call the server, homsar the client.
 
Are you sshing from a Terminal.app window, or from an xterm running within X11? To know how to forward X11 connections, ssh has to be able to find info about a running X11 instance in its own environment.
 
MAN why didn't I think of that !

(it worked by the way, at least over my LAN, and I can't imagine from the WAN it'll be any different).

Thanks for all the help guys. Using X-forwarding is especially important to me because I have such a tiny hard disk on my iBook that I try to put as much software on my iMac as I can...plus it takes /forever/ to compile big apps on my iBook.

PS in hindsight that would also explain why $DISPLAY wasn't set eh! Kind of odd that I don't need to use xterm to start local X11 apps...maybe it's one of those Apple (quartz) things that aims to make things easier to the user but really in the end just does something unexpected? :p
 
Back
Top