Skip to main content

Fix ssh -Y with other Macs OSX 10.8 Mountain Lion

You may have realised that when you try use ssh -Y on another Mac from Mountain Lion you get the following error :

Warning: No xauth data; using fake authentication data for X11 forwarding.X11 forwarding request failed on channel 0




Fixing this error only takes some simple configuration. All you have to do is add these lines to the following files on both machines:

/etc/sshd_config

X11Forwarding yes
XauthLocation /opt/X11/bin/xauth
XauthLocation /usr/X11R6/bin/xauth


/etc/ssh_config

XauthLocation /opt/X11/bin/xauth
XauthLocation /usr/X11R6/bin/xauth


That should be all you need to get rid of the authentication error. Hope this was helpful.

Comments

  1. Thanks! This worked like a charm. It's been driving me crazy. Grateful for your post.

    ReplyDelete
  2. Do these instructions assume that I've already installed XQuartz? If 10.8 doesn't ship with X11 any more, what's all that in the /usrX11 and /usr/X11R6 directories? And why do you refer to the directory /opt/X11 - are you assuming the machine I'm ssh-ing into is running Linux (my Mac doesn't have an /opt directory). Needless to say, just following these instructions didn't allow me to ssh -X ... into my work!

    ReplyDelete
    Replies
    1. You do need XQuartz installed at which point /opt/X11 will exist, this was done Mac to Mac.

      Delete
  3. Hello,
    The error message did actually disappear, but I still can't forward my app trough the ssh tunnel.
    For example, I log via ssh to my distant Mac and I would like to use Calculator. How do I do to actually see the Calculator window on my local Mac ? Would you have an example to give me ?
    I would be very pleased. Thank you

    ReplyDelete
    Replies
    1. First off you need to make sure that the calculator is an x11 app. If so , simply ssh -Y into the machine and launch the calculator from the terminal. Unfortunately only x11 apps can be used in this way.

      Delete
    2. Oh, thank you very much for your answer. The applications I tried must not have been x11 apps then.

      Delete

Post a Comment