Sunday, March 26, 2017

SSH X11 Forwarding and Mac OS X Sierra

I want to run remote Firefox locally on my computer. I have an SSH server running on Ubuntu 15 and an SSH client on Mac OS X Sierra. I've done this before, I would've thought it's as easy as enabling "-X", right? No so, this time. It looks like luck isn't on my side.

I have to enable debugging by using "-vvv" from SSH client to understand the problem:

ssh -vvv -X user@remote.com

The log contained:

debug1: No xauth program.

Warning: untrusted X11 forwarding setup failed: xauth key data not generated

Obviously, I need the extra "-Y" to enable trusted X11 forwarding:

ssh -vvv -XY user@remote.com

This time, it contained:

debug1: No xauth program.

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

The problem must be related to xauth and I can't find this anywhere on Sierra. Googling the web, the link below came to my attention:
https://origin-discussions-us.apple.com/thread/7685786?start=0&tstart=0

So, I the solution here is to install XQuartz as this comes with the xauth binary.

After the installation, Sierra SSH configuration files /etc/ssh/sshd_config and etc/ssh/ssh_config both contains:


XAuthLocation /opt/X11/bin/xauth

A new directory X11 exists under "/opt" and xauth exists under "/opt/X11/bin".

Another attempt with the following command shows Firefox running remote on Ubuntu and displayed locally:

ssh -XY user@remote.com firefox

To improve local connection speed, you could request compression by adding "-C" when executing SSH:

ssh -XYC user@remote.com firefox


No comments:

Post a Comment