Ssh – How to prevent the warning No xauth data; using fake authentication data for X11 forwarding

sshx11

Every time I initiate an ssh connection from my Mac to a Linux (Debian) I do get this warning:

No xauth data; using fake authentication data for X11 forwarding.

This also happens for tools that are using ssh, like git or mercurial.

I just want to make a local change to my system in order to prevent this from appearing.

Note: I do have X11 server (XQuartz 2.7.3 (xorg-server 1.12.4)) on my Mac OS X (10.8.1) and it is working properly, I can successfully start clock locally or remotely.

Best Answer

None of the posted solutions worked for me. My client (desktop) system is running macOS 10.12.5 (Sierra). I added -v to the options for the ssh command and it told me,

debug1: No xauth program.

which means it doesn't have a correct path to the xauth program. (On this version of macOS the path to xauth is nonstandard.) The solution was to add this line to /etc/ssh/ssh_config (may be /etc/ssh/config in some setups) or in ~/.ssh/config (if you don't have admin rights):

XAuthLocation /opt/X11/bin/xauth

Now the warning message is gone.