YasonX

Q: ssh warns: using fake authentication data for X11 forwarding

(This is a tip, not a question)

 

tl;dr: tell your ssh client config where to find xauth

 

After upgrading to macos sierra, my typical morning login to my remote workhorse suddenly started displaying

 

user@host1:~ $ ssh -XY host2

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

Last login: Tue Sep 27 08:43:53 2016 from 10.x.y.z

user@host2:~ $


I don't really like fake authentication, and I know that it worked yesterday without this message. Emptying out my Xauthority files on either end didn't work. What did work, was to tell ssh where to find X11's xauth tool, from XQuartz in my case, inside my ssh client user configuration.


First, you need to figure out where the xauth tool is located:


user@host1:~ $ type xauth

xauth is /opt/X11/bin/xauth


Then, you can add this location with the XAuthLocation key into your ssh's user configuration file (assuming you already have such a file present):


user@host1:~ $ echo XAuthLocation=/opt/X11/bin/xauth >> $HOME/.ssh/config


After this tweak, no more complaints logging into my remote host:

 

user@host1:~ $ ssh -XY host2

Last login: Tue Sep 27 08:52:13 2016 from 10.x.y.z

user@host2:~ $


Hope this helps!


MacBook Pro, macOS Sierra (10.12), MacBookPro8,2 2.2GHz qc-i7 8GB

Posted on Sep 27, 2016 9:10 AM