Mac OS X X11 GUI forwarding...

In these days of Apple Remote Desktop or Windows Remote Connection is easy to forget about the tried and true X forwarding. For people like me that somethings needs to check the output in the form of a graph forwarding is very useful. However, Mac OS X has this feature disable by default. Here is how to enable it:

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

sudo mv /tmp/sshd_config /etc/.

You may need to logout or even restart but after that everything will work just fine.

PS: use the ssh with the flag -Y to ensure proper forwarding.

Comments

Unknown said…
or you can just make your ssh config file under your home directory.

.ssh/config:

Host *
ForwardX11 yes
Gert Wohlgemuth said…
i would rather recommend to use -X to increase the security.

Explanation, taken from the gentoo wiki:

-X vs -Y
ssh -X is also known as secure X11-forwarding: it's secure, i.e., the server(running sshd) won't be able to spy on the client (key-logging etc...) ssh -Y is also known as insecure X11-forwarding: it's not secure but it can run more applications
Also, you may wish to use compression to speed things up.

ssh user@remotebox -YC

-or-

ssh user@remotebox -XC
Anonymous said…
Well I'm able to SSH to my MAC and it created the Xauthority file just like it normally does if its working, but whenever I try to run an App, it doesn't X11 forward it, but rather displays it on the console screen of the MAC.

Is there some magic to telling it where to display it? Normally with linux, the applications just appear on my desktop when I X11 forward them.

FYI I'm on an ubuntu desktop, mac is osx lion and I tried with both -X and -Y but both have same behaviour for me, application starts can be seen in process list but output is displayed on the monitor of mac not forwarded to my linux desktop :(
wtigger said…
Most Mac Apps do not use X11. Thus, they cannot be forwarded. You might use VNC, thou.

Popular Posts