Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

ssh works fine when when I log-in from OSX Lion to Lion or Lion to Ubuntu.

ssh -X (X-forwarding) works fine when I log-in from Lion to Ubuntu.

However, I can't seem to get ssh -X to work from Lion to Lion.

How do I enable X forwarding on OSX Lion so I can run x applications from a remote machine?

share|improve this question
up vote 7 down vote accepted

X11 forwarding is disabled per default for OS X SSH servers. Do the following on the remote machine:

sudo vi /etc/sshd_config

Search for the following line and remove the # sign at the beginning, change the no to yes, so that you end up with this:

X11Forwarding yes

Then write the file and quit vim by hitting ESC and typing :wq and hitting return.

Now restart the sshd process by typing:

killall -SIGHUP sshd

This will kill your ssh session, but after that you should be able to use ssh -X as usual. You may get warnings because of missing X authority files.

share|improve this answer
works great - tyvm – kfmfe04 Jan 4 '12 at 15:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.