I get Warning: No xauth data; using fake authentication data for X11 forwarding. when I do ssh to other machines from my OS X machine which has X-server installed.

echo $DISPLAY returns something like /tmp/launch-4eEyr6/org.macosforge.xquartz:0

Inside ~/.ssh/config I specified XAuthLocation xauth but I still get the errors.

If I replace the line with full path to xauth (/opt/X11/bin/xauth), I stop getting the errors but the problem is that I do share the ssh config file between several machines, so I cannot put a path that is specific to Mac on it.

I would prefer a solution that would not require me to create a symlink on Mac from /opt/X11/bin/xauth to /usr/bin/xauth.


Put XAuthLocation=/opt/X11/bin/xauth in /etc/ssh/ssh_config.


I see it's an old question but for the sake of Google, here is my answer.

On the Mac, you can create an alias in ~/.bashrc like so:

alias ssh='ssh -o "XAuthLocation=/opt/X11/bin/xauth"'

If you also share the .bashrc across both OS X and other unixy machines, you could add a little stanza to the .bashrc as follows:

if [ `uname` == 'Darwin' ]; then
    alias ssh='ssh -o "XAuthLocation=/opt/X11/bin/xauth"'
  • I'd like to add that you can edit the /etc/ssh/ssh_config file on the individual machines to add the XAuthLocation information that applies to that particular machine. – Bill Waggoner Oct 29 '16 at 15:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .