Warning: No Xauth Data; Using Fake Authentication Data for X11 Forwarding: How to Fix

Warning: No Xauth Data; Using Fake Authentication Data for X11 Forwarding
Warning: No Xauth Data; Using Fake Authentication Data for X11 Forwarding

DISCLOSURE: This post may contain affiliate links, meaning when you click the links and make a purchase, we receive a commission.

Using graphical applications via the x11 forwarding feature has enhanced the experience of a remote SSH connection. However, it can be stressful to get weird alert prompts while developing the connection with the remote server.

Plus, the presence of strange terms in the prompt can make the troubleshooting process quite challenging for you. Don’t lose hope, though, as this guide is focused on troubleshooting a similar alert prompt, “Warning: No Xauth Data; Using Fake Authentication Data For X11 Forwarding”.

Let’s discuss this error, its causes, and the best ways successfully to fix it yourself!

What Does The “Warning: No Xauth Data; Using Fake Authentication Data For X11 Forwarding” Message Mean

The Xauth error typically occurs when you use the ssh command with the -X or -Y option to enable x11 forwarding but the Xauth program is not found or is not functioning correctly on the system, resulting in the Xauth program using a fake authentication instead.

The Xauth error is often the result of a combination of factors. Some of the key causes include issues with the configuration file, incorrect DISPLAY variable, or problems with the authentication data file on the client machine.

Portrait of young businessman scratching his head while working at home using computer

Not fixing this warning will limit your ability to run graphical applications on the remote machine and display their windows on your local machine. Instead, you may have to use command-line tools or run the applications directly on the remote machine.

Reasons For The “Warning: No Xauth Data; Using Fake Authentication Data For X11 Forwarding” Prompt

The warning message that may appear while using x11 forwarding with SSH can be unusual, but it is important to understand the potential causes and background in order to troubleshoot the issue effectively. Some of the common reasons for this warning to appear are listed below:

  • Issues With The Configuration File

The ssh_config is an essential file that is used to configure the behavior of the ssh command on the client machine. You can say that most of the SSH errors are due to this file’s unattended settings, which the end-user fails to update on his own.

In the default scenario, many options are already handled but commented out too because they are not expected to be used. Hence this may lead to the generation of the Xauth error prompt because the system simply ignored those settings.

  • Incorrect DISPLAY Variable

The DISPLAY variable is used to specify the location of the X Window System display that should be used to display GUI applications. Setting this variable inside the .bashrc file allows you to define the default display that should be used for GUI applications when you open a new terminal window.

Pensive young biracial woman in glasses look at laptop screen

However, if you don’t set the DISPLAY variable, you may still be able to use GUI applications from the terminal, but the display location may not be specified or may be set to the default value. This could result in GUI applications being displayed on an unintended or undesired display or not displayed at all.

  • Issues With Authentication Data File

The .Xauthority file is a file that X Window System uses to store authentication data for x11 connections. While this file doesn’t have a direct relationship with the warning prompt but may be related if there are issues with the file itself on the client machine.

For instance, in Fedora OS, this file may not exist itself that is, you’ve to create it yourself. Similarly, this file may exist in macOS Sierra but with issues leading toward this warning prompt.

Effective Troubleshooting Techniques for the “Warning: No Xauth Data; Using Fake Authentication Data for X11 Forwarding” Prompt

If you have tracked the exact cause of the warning prompt, fixing it should be relatively straightforward. However, it may be more tricky for those not well-versed in using SSH. To assist with resolving the issue and getting to use the x11 forwarding feature smoothly, we have provided three troubleshooting methods:

Method 1: Modifying The Configuration File

Updating the configuration file is simply proofreading it by uncommenting some lines and toggling some options which weren’t required earlier.

Before continuing, we expect you’ve already installed Xming on Windows, XQuartz on MacOS, or SSH, Xauth, and Xorg if you use Ubuntu. You can use the following command on Ubuntu bash to install these items: sudo apt install ssh xauth xorg

Afterwards, you have to open your ssh_config file (as administrator), which is located inside the /etc/ssh or ~/.ssh (or /private/etc/ssh for MacOS) directory and perform the following operations:

  1. Remote hash (#) symbol and set the arguments to yes in these lines:
    Host *
      ForwardAgent yes
      ForwardX11 yes
      ForwardX11Trusted yes
  1. In addition, remove the hash (#) symbol before the Port and Protocol too:
    # IdentifyFile …
    Port 22
    Protocol 2
    # Cipher …
  1. State the Xauth file location at the end of the configuration file, that is, XauthLocation /usr/bin/xauth

Xauth file location

You can double check your Xauth location with which command: which xauth

In MacOS, the Xauth file location will usually be /opt/x11/bin/xauth. Hence, the above command will be: XauthLocation /opt/x11/bin/xauth

That’s all editing that should be done inside the configuration file. Don’t forget to save it before leaving the editor. However, if the error prompt’s still not fixed, you can move on to the next fix.

Method 2: Setting DISPLAY Variable

You may want to set the DISPLAY variable to ensure that GUI applications are displayed correctly. You can set it using the following steps:

  1. Relocate to the ~ or $HOME directory.
  2. Append the following command to your .bashrc file

    export DISPLAY=localhost:0

Don’t forget to save the file before closing it!

Method 3: Fixing The Authentication Data File

This fix regarding the authentication data file, more specifically, varies according to the operating system. We’ve observed that this issue is more likely to occur in Fedora System or macOS Sierra.

  • Fedora System

If you are using the Fedora system, which lacks the ~/.Xauthority file, you can create one by executing the following command on the Fedora system of the client machine: xauth add :0 . ‘mcookie’

  • macOS Sierra

If you are using macOS Sierra, which already contains the ~/.Xauthority file but contains issues, you may try removing it (from the root folder) using the following command: ~$ mv ~/.Xauthority ~/.Xauthority.bak

Afterwards, try connecting again to the remote server using SSH. Consequently, a new magic cookie will be automatically put back in the ~/.Xauthority file once you’ve logged in again. Moreover, no Bash scripting is required in this step at all.

Testing The Fix

UNIX bash shell green color on black background

After you have followed the steps, you need to restart the Bash Shell or open the Xming program and use the following command: ssh -X [email protected]

You can refer to this GitHub guide for detailed insights about the first two methods, which we’ve explained above.


We hope that with the methods outlined in this guide, you were able to troubleshoot the issue, allowing you to use GUI applications from the terminal over SSH.

If you are still having trouble, you may consider seeking help from someone with expertise in SSH and X11 forwarding. Remember to be patient and persistent, and you will eventually find a solution to the Xauth error warning.