Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have an unfortunate problem when making ssh connections from Fedora 23 to Centos 7. The commands ssh -X user@centos7 and ssh -Y user@centos7 both print Warning: No xauth data; using fake authentication data for X11 forwarding.

Googling shows to add the following lines to /etc/ssh/ssh_config:

Host *
    ForwardX11Trusted yes
    ForwardAgend yes
    ForwardX11 yes

But this didn't make the warning message go away.

like image 262
A. Koenig Avatar asked Oct 15 '16 07:10

A. Koenig


2 Answers

For me this issue was caused by my Fedora system not having an ~/.Xauthority file.

I created one by executing the following commands on my Fedora system (Client machine):

xauth add :0 . `mcookie`
like image 143
HeatfanJohn Avatar answered Nov 16 '22 20:11

HeatfanJohn


Letting Ubuntu bash on Windows 10 run ssh -X to get a GUI environment on a remote server

  • First

Install all of the following. On Windows, install an X server, e.g.Xming. On Ubuntu bash, use sudo apt install to install ssh xauth xorg.

sudo apt install ssh xauth xorg
  • Second

Go to the folder contains ssh_config file, mine is /etc/ssh.

  • Third

Edit ssh_config as administrator(USE sudo). Inside ssh_config, remove the hash # in the lines ForwardAgent, ForwardX11, ForwardX11Trusted, and set the corresponding arguments to yes.

# /etc/ssh/ssh_config

Host *
    ForwardAgent yes
    ForwardX11 yes
    ForwardX11Trusted yes
  • Fourth

In ssh_config file, remove the front hash # before Port 22 and Protocol 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.

# /etc/ssh/ssh_config

#   IdentifyFile ...
    Port 22
    Protocol 2
#   Cipher 3des
#   ...
#   ...
    ...
    ...
    GSSAPIDelegateCredentials no
    XauthLocation /usr/bin/xauth
  • Fifth

Now, since we are done editing the ssh_config file, save it when we leave the editor. Now go to folder ~ or $HOME, append export DISPLAY=localhost:0 to your .bashrc file and save it.

# ~/.bashrc
...
...
export DISPLAY=localhost:0
  • Last

We are almost done. Restart your bash shell, open your Xming program and use ssh -X yourusername@yourhost. Then enjoy the GUI environment.

ssh -X yourusername@yourhost

The problem is also in Ubuntu subsystem on Windows, and the link is at

https://gist.github.com/DestinyOne/f236f71b9cdecd349507dfe90ebae776

like image 11
DestinyOne Avatar answered Nov 16 '22 18:11

DestinyOne