Skip to content

Instantly share code, notes, and snippets.

@volks73
Last active October 13, 2021 06:35
Show Gist options
  • Save volks73/87d30786672e886bf542d93b8ac0f067 to your computer and use it in GitHub Desktop.
Save volks73/87d30786672e886bf542d93b8ac0f067 to your computer and use it in GitHub Desktop.
Fix for warning about fake authentication when X11 forwarding through SSH and WSL2

SSH X11 Forwarding with XAuth and WSL2

Assuming WSL2 is installed, configured, and the VcXsrv is working, if the following error message appears when logging into a remote machine using X11 forwarding, i.e. ssh -X user@remote:

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

then, ensure the xauth application is installed in the WSL2 host,

user@wsl2-host:~$ sudo apt install xauth

and entering the following:

user@wsl2-host:~$ xauth generate $DISPLAY . trusted

Note, this may need to be added to the ~/.bashrc or ~/.zshrc or ~/.profile files because the contents of the DISPLAY environment variable may change on reboot of the Windows host machine or the WSL2 virtual machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment