I've looked around for an answer to this question off and on for the past few weeks, but none of the solutions I've seen have worked for me. I've tried deleting the .Xauthority file in both locations. I use Cygwin X to access another computer. Recently X11 forwarding hasn't been working. After starting the X server on my local machine:

[local]$ export DISPLAY=0.0    
[local]$ ssh -XY user@remotelocation
Warning: No xauth data; using fake authentication data for X11 forwarding.

I'm not sure if this is helpful, but:

[remote]$ xauth list
location/unix:10 MIT-MAGIC-COOKIE-1 304eb389beb66bf44ae6bc1821bdf472

Finally, the problem occurs here:

[remote]$ gedit file &
X11 connection refused because of wrong authentication.

I've always received the "no xauth data; using fake authentication" warning, but recently the X11 connection has been refused as a result. Do you have any suggestions?

  • 1
    Welcome to U&L. Please edit your question here by adding the output of grep -v '^#' /etc/ssh/ssh_config
    – GAD3R
    Commented Nov 24, 2017 at 21:00

1 Answer 1


I've tried deleting the .Xauthority file in both locations.

Maybe something went wrong before that, but you certainly aren't going to succeed after this. If you found this advice somewhere, and they weren't referring to some extremely unusual circumstance that doesn't apply to you, blacklist that source. Restore the .Xauthority file on the client.

If you've lost the .Xauthority file, you may be able to restore it from a running process or from a temporary file. I have no idea how to do it with Cygwin. The simple way that will work everywhere is to quit the X server and start a new one.

If you get the message “no xauth data; using fake authentication”, then remote applications aren't going to be able to display on your local server unless it's configured with security turned off. Without the security of xauth, anybody can spy on your X session and inject input if they can access the X server; depending on the configuration, they may need to be local users (in which case it isn't so bad on a single-user operating system) or it may be enough that they can open a TCP connection to your machine (i.e. they're in your local network, which could be anybody if you're e.g. using public wifi). If it used to work and no longer does, it may be because some missing security check was recently fixed.

Once you have a valid .Xauthority file, open a shell and check that you can run local applications such as gedit. From that same shell, run ssh -X user@remotelocation and try running an X application. Either that will work or you'll get error messages; read them, and copy-paste them if you ask for help. If it doesn't work, run ssh -vv -X user@remotelocation; the extra debugging output will give some information as to why it doesn't work.

Do make sure that the server allows remote X connections. With OpenSSH, the file /etc/sshd_config (or /etc/ssh/sshd_config or some other location depending on the distribution) must contain X11Forwarding yes.

You must log in to answer this question.

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