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.
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 thessh
command and it told me,which means it doesn't have a correct path to the
xauth
program. (On this version of macOS the path toxauth
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):Now the warning message is gone.
Found the cause, my
~/.ssh/config
was incomplete, you need both:My mistake was that I included only the ForwardX11 option.
Letting Ubuntu bash on Windows 10 run
ssh -X
to get a GUI environment on a remote serverInstall all the following. On Window, install
Xming
. On Ubuntu bash, usesudo apt install
to installssh xauth xorg
.Go to the folder contains
ssh_config
file, mine is/etc/ssh
.Edit
ssh_config
as administrator(USEsudo
). Insidessh_config
, remove the hash#
in the linesForwardAgent
,ForwardX11
,ForwardX11Trusted
, and set the corresponding arguments toyes
.In
ssh_config
file, remove the front hash#
beforePort 22
andProtocol 2
, and also append a new line at the end of the file to state the xauth file location,XauthLocation /usr/bin/xauth
, remember write your own path of xauth file.Now since we are done editing
ssh_config
file, save it when we leave the editor. Now go to folder~
or$HOME
, appendexport DISPLAY=localhost:0
to your.bashrc
file and save it.We are almost done. Restart your bash shell, open your
Xming
program and usessh -X yourusername@yourhost
. Then enjoy the GUI environment.The problem is also in Ubuntu subsystem on Windows, and the link is at
https://gist.github.com/DestinyOne/f236f71b9cdecd349507dfe90ebae776
Note: the linked text includes 2 typos (
XauthLocaion
instead ofXauthLocation
)As noted, it seems that
xauth
on OS X Yosemite has regressed to an old version that doesn't work with XQuartz's$DISPLAY
setting:I would add this as a comment, but I don't have enough rep. Adding one more line to sorin's solution worked for me.
On the client machine, edit your ssh config file with
vim ~/.ssh/config
Then add these lines to it:
You can double check your
xauth
location with:There is a bug in MacOS at the moment. I came across this too. The fix for me involved adding the following to my .bash_profile
Essentially the name for the file pipe associated with your X root can't be handled correctly, and thus needs correction. :-)
i just removed ~/.Xauthority (destination machine) from my root folder and ssh -X 192.168.123.1 again and ik worked.
Including
XAuthLocation /opt/local/bin/xauth in ~/.ssh/config
in my macOS Sierra 10.12.6 worked for me. A small change from answer 7).
This started happening to me after moving my Cygwin installation from one PC to another. The issue seemed to be the hostname change: the magic cookie no longer corresponded to the hostname of the new PC.
Running
on the local Cygwin installation fixed the problem for me --
xauth list
now listed a magic cookie associated with the correct hostname of the new PC, and the warning stopped appearing.In my case it was the problem of .Xauthority containing the Magic cookie not forwarded, Fabby on http://askubuntu.com/questions/571116/ recommends on 2014-11-14 to add this line at the end of the .bashrc or . profile to allow forwarding of xauth keys between users when calling su:
I added also previously:
to ensure remote called with ssh -X ̍@ will find it.
In my case .Xauthority is a symlink to original user /home//.Xauthority I su from...
with correct rights:
so it is accessible to and to . will be able to trigger apps on and display X-windowed result on its local screen throughout proxy account !
TIP : Check xauth list...if reflects magic cookie on .