PDA

View Full Version : Can't open display


lih82
11-17-2006, 08:42 PM
Hello,

I am getting the 'E233: cannot open display' message. I used 'ssh -X user@host' and 'ssh -Y user@host' to connect, and I also have a config file under the .ssh folder of the remote machine. I can connect to another server and able to run xclock with my mac, but it is just this particular machine which I can't open the window. I also added the 'ForwardX11 yes' option to my config file.

Another thing is that, I run xhost +machine and then it works. It is just the ssh tunneling that doesn't work and I want to stick with this option since it is the most secured. Any insights about this problem?

Thanks a lot

mbanks
11-18-2006, 02:43 PM
I also added the 'ForwardX11 yes' option to my config file.

Another thing is that, I run xhost +machine and then it works. It is just the ssh tunneling that doesn't work and I want to stick with this option since it is the most secured. Any insights about this problem?

OK, I just have to check this: When you say "my config file", you do mean the config file on the server you're connecting to - right? Also, you re-started sshd on that remote machine after making that change - right?

So, when you log into the server (ssh -X user@foo.com), what is the DISPLAY environment variable? Is it automatically set to localhost:10.0?

Here's what I just did from my mac to my Solaris box:

[MBG4:~] matt% ssh -X matt@10.0.0.199
Password:
Last login: Sat Nov 18 12:34:17 2006 from 10.0.0.210
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
dbox:matt:1:matt:% echo $DISPLAY
localhost:10.0
dbox:matt:2:matt:% firefox &
[1] 24187
dbox:matt:3:matt:%
And firefox came right up. No xhost command was run. Now, there are some apps that just don't like to work over ssh for some reason. dtterm is a prime example of that. It works fine over a direct connection, but not via ssh. I have no idea why.

If the DISPLAY variable isn't being set, check your sshd config on the server.

Hopefully that helps a bit.

lih82
12-08-2006, 11:24 PM
It turns out to be a firewall problem with the remote machine.