X11 Forwarding and SSH on OS X
Posted by Andy Atkinson on 11/7/05 in OS X, Software, Tips
This article is a quick and dirty guide detailing my experience getting X11 Forwarding to work on OS X. You don’t need to know all of the details of the X Window System or of the XFree86 Project to get this working, I found I just needed to know which ssh flags to use with the computer I was connecting to. One of the really useful things about my new iBook is having a system running ssh and capable of X11 Forwarding out of the box. This allows me to easily connect to machines at school for programming and other IT homework. Read on for details about how to get this working or add comments on your experience with OS X and X11.
I’m running OS X 10.4, so I needed to install X11 from my OS X install CD 1. This is not installed by default.

Once I installed X11, I expected to be able to open a Terminal window, ssh into a computer, and open a text editor like emacs in a background process. This didn’t work. Here is a quote from Apple’s Developer page on X11:
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.
So far I haven’t done this because I was able to connect to machines at the University of Minnesota without editing any config files. By typing man ssh you can view all of the different flags you can use with ssh. To connect to machines at the Univeristy, I needed to add the -Y flag.
I was able to launch X Windows applications with a X11 Terminal only, and not with the built-in OS X Terminal.

I’ve intentionally blurred machine names in the screenshots, but I’ve included the specific string I used to connect to machines at the University below. Note that the “l” is a letter and not the number “1.”
$ ssh -Y machine_name -l username

Now that I was logged-in to a Linux machine, I was able to launch X applications as background processes and maintain one ssh shell into the remote system. In the screenshot below I am launching the emacs text editor.

Summary
X11 Forwarding is certainly possible on other operating systems like Windows and Linux, but I’ve never used anything that integrated as well as the implementation on OS X. Please feel free to add additional comments on X11 Forwarding or XFree86 and OS X in the comments. Here is an article on X11 and OS X, and this page contains a technical Q&A about more on X11 Forwarding.
permalink | trackback url |
Subscribe in a reader
Similar Posts
- Fix your mom’s computer with UltraVNC
- Remote Desktop over the Internet from Windows or OS X
- Basic Tips for New Mac Users
- Mac OS X Image Capture
- Remote Connection and Assistance Roundup

Support for articles is not available due to the volume of help requests we get. Anything resembling Spam, or comments that offer little value, will be promptly deleted.
Post a Comment