Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

X11 forwarding not working

I'm running OS 10.4.7. I've successfully installed X11 and ssh'd over to the linux box at work. But even though I've used the -X or -Y option for ssh, typing "xclock" over there just gives me an error message: "Error: Can't open display: work:0", where work is the name of the box that I'm connected to over there.

So, I suspect that the problem isn't with some sort of permission that needs to be set over here on my mac, but rather that the message to do X11 forwarding isn't getting through.

I also tried a "setenv DISPLAY" command on the remote computer, using the IP address that my mac seems to have. When I did that, typing "xclock" just makes the shell hang, as though it believes that it's displaying an xclock somewhere in the world. But I can't see it.

So what should I do? Is there something different that I need to do for the forwarding information to get sent over with my ssh command? Or should I use the "setenv DISPLAY" option, and do something so that my mac actually shows me the xclock?

Any help greatly appreciated.

MacPro Mac OS X (10.4.7)

Posted on Dec 25, 2006 2:12 PM

Reply
5 replies

Dec 28, 2006 9:33 PM in response to Medhead

Using X-forwarding, you must not set DISPLAY on the remote system. If you are running ssh from a Terminal.app window, then DISPLAY should be set to "😮.0" on the Mac. ssh will set it on the remote system -- it should be something like "localhost:10.0" -- and you must not tamper with its setting.

Also, make sure that the Linux box is set up to permit X-forwarding.

Dec 31, 2006 9:29 AM in response to Jeffrey Jones2

Thanks for the reply. The remote linux box is definitely set up to do X forwarding -- I can make it work when ssh'ing from elsewhere, using setenv DISPLAY. But not from my mac.

In my local xterm window, DISPLAY on my mac is indeed set to 😮.0. But on the remote system, DISPLAY is set to the name of the remote box, not "localhost:10.0" or anything like that.

Dec 31, 2006 10:13 AM in response to Jeffrey Jones2

I found a web page that appears to answer the question of how to do this:

http://developer.apple.com/qa/qa2004/qa1383.html

The idea is OS X by default does not allow X11 fowarding, for security reasons. So, you have to enable it, by doing this:

sed 's/#X11Forwarding\ no/X11Forwarding\ yes/' /etc/sshd_config > /tmp/sshd_config

sudo mv /tmp/sshd_config /etc/.

Actually, it seems to me that there should probably be a # before the new version of the X11Forwarding. But I've tried it both ways, and I still can't get forwarding to work. Making a similar modification to /etc/ssh_config doesn't help either.

Dec 31, 2006 11:17 AM in response to Medhead

The sshd_config modification is only if the Mac is the remote system. That is what would be needed on the Linux box, if it were not already configured that way.

Be sure that you don't have a login profile or something on the Linux system that is setting DISPLAY. Otherwise, try asking your question in the Unix forum here at Apple Discussions.

<http://discussions.apple.com/forum.jspa?forumID=735>

X11 forwarding not working

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.