Reputation: 1121
Hey I'm having an issue getting ssh X forwarding to work. The setup is I'm ssh
ing 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?
Upvotes: 83
Views: 106132
Reputation: 1
Same as answered by user Xvalidated above. but there was no ssh_config file in my .ssh directory. 1. copy ./etc/ssh_config to ~/.ssh/ #file if not there 2. edit Host hostname ForwardX11Trusted yes ForwardX11 yes
Upvotes: 0
Reputation: 466
I just hit this issue using Mac OS X 10.6.8 to Linux Debian 9. None of the solutions provided worked.
Root cause was: loopback interface was "DOWN" on the target Linux host.
I had to type the following on the target host to fix the issue
ip link set lo up
Upvotes: 0
Reputation: 1039
Note that some incomplete answers might lead to security flaws.
/usr/X11R6/bin
and on macOS with XQuartz it is in /opt/X11/binSecure solution:
Enable the first option in the Security tab of preferences (Cmd-,) which enables authenticated connections.
Edit ~/.ssh/config
, add XAuthLocation /opt/X11/bin/xauth
to the host config.
ssh -X your_server
works in a secure manner.
Ensure xauth is installed on the destination host.
Upvotes: 92
Reputation: 499
Gilles Gouaillardet has the answer that solved this for me. Edit ~/.ssh/config to contain
Host *
XAuthLocation /opt/X11/bin/xauth
and ssh -X hostname now works (XQuartz 2.7.11, macOS 10.4 Mojave)
Upvotes: 13
Reputation: 36
When you login the cluster, do not use -X or -Y options.
Example:
ssh -Y remotelogin: gives me X11 related warning.
ssh remotelogin: No warning, works fine.
Upvotes: -4
Reputation: 1011
I received the same warning as you after upgrading to Yosemite.
After I added ForwardX11Trusted yes
in my ~/.ssh/config
file, the warning disappeared.
Do you have the following lines in your ~/.ssh/config
file for enabling Trusted X11 forwarding?
Host APPROPRIATE_HOSTNAME
ForwardX11Trusted yes
ForwardX11 yes
OTHER_OPTIONS
Upvotes: 42
Reputation: 71
I already had the latest XQuartz 2.7.11 installed, but I think I've also updated the OS a few times since then. I reinstalled XQuartz 2.7.11, and now it is working fine.
Upvotes: 7
Reputation: 617
On macOS Sierra, I now have to do ssh -Y
instead of ssh -X
to get a display from a linux machine to work on my Mac.
Upvotes: 60
Reputation: 11
ForwardX11Trusted is required even for connections you think are untrusted when your X server doesn't have the SECURITY extension (Apple servers have a ton of visuals that take up over 100 lines, so I suggest "xdpyinfo | grep SECURITY" to check; if that returns no output, you don't have it). There may be other reasons and exceptions, but this worked for me.
Upvotes: 1