Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSH -X "Warning: untrusted X11 forwarding setup failed: xauth key data not generated"

Tags:

ssh

xserver

xorg

Hey I'm having an issue getting ssh X forwarding to work. The setup is I'm sshing into my ubuntu VM off OSX Yosemite host machine.

I already installed xQuartz on OSX, xauth on ubuntu, and I believe I've have all the correct options set in ssh_config files.

I get the

Warning: untrusted X11 forwarding setup failed: xauth key data not generated X11 forwarding request failed on channel 0 

message when opening a connection with ssh -X, and when I tried to run an X application:

xterm: Xt error: Can't open display: xterm: DISPLAY is not set 

I have the identical setup on my other machine except running Mavericks and it works fine, is there something specific to Yosemite specific I have to worry about?

like image 906
sprw121 Avatar asked Dec 09 '14 17:12

sprw121


1 Answers

Note that some incomplete answers might lead to security flaws.

  1. Using ssh -Y means here having fake xauth information which is bad!
  2. ssh -X should work since XQuartz, once enabled, uses xauth. The only problem is that ssh is looking for xauth in /usr/X11R6/bin and on macOS with XQuartz it is in /opt/X11/bin

Secure solution:

  1. Enable the first option in the Security tab of preferences (Cmd-,) which enables authenticated connections.

  2. Edit ~/.ssh/config, add XAuthLocation /opt/X11/bin/xauth to the host config.

  3. ssh -X your_server works in a secure manner.

  4. Ensure xauth is installed on the destination host.

like image 154
Koko Avatar answered Oct 09 '22 11:10

Koko