Enabling X11 Forwarding

Q: I need to ssh to a remote Mac OS X system and run an X11 application. However, when I try to execute the application, the system responds with "Error: Can't open display: ". What's wrong?

A: The remote system does not have "X11 forwarding" enabled. X11 forwarding allows the X11 connection to be tunneled from the remote system to the local system. For security reasons, Mac OS X does not enable X11 forwarding by default. In order for clients to receive X11 forwarding, the system administrator must explicitly enable it on the Mac OS X system. This is done by altering the /etc/sshd_config file, either by manual edit, or as shown in Listing 1.

Listing 1: Enabling X11 Forwarding

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

Document Revision History

DateNotes
2004-10-25Updated command line syntax.
2004-09-23Describes how to enable ssh clients to receive X11 communication from a Mac OS X system.

Posted: 2004-10-25


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.