1

I've been getting some problems with the X11 forwarding feature. Basically, I have a Manjaro machine with SSH installed and my goal is to foward the content of this machine to another. What would be the main settings I should pay attention to?

I have been reading countless tutorials and even trying to implement them but somehow the information provided is too generic and I'd appreciate if I could get a better understanding of the process revolving around X11 and how to properly set it up.

ᄂ ᄀ
  • 4,187

1 Answers1

3

Install openssh on both machines.

2 steps: Setting up the ssh server, then forwarding X.

Client refers to the other machines, and server refers to the Manjaro machine.

Setting up the ssh server

  1. Install openssh-server
  2. Check sshd (the server process) is running with pgrep sshd (Will output nothing if sshd isn't running).
  3. Ensure you have either a very strong password, or disable password authentication and use key forwarding by editing /etc/ssh/sshd_config and changing PasswordAuthentication yes to PasswordAuthentication no, then sudo restart ssh.
  4. Ensure you can log into the server from the client via ssh.

X forwarding

Follow the instructions in this answer. Copied here:

"On the client side, the -X (capital X) option to ssh enables X11 forwarding, and you can make this the default (for all connections or for a specific conection) with ForwardX11 yes in ~/.ssh/config.

On the server side, X11Forwarding yes must specified in /etc/ssh/sshd_config. Note that the default is no forwarding (some distributions turn it on in their default /etc/ssh/sshd_config), and that the user cannot override this setting.

The xauth program must be installed on the server side. If there are any X11 programs there, it's very likely that xauth will be there. In the unlikely case xauth was installed in a nonstandard location, it can be called through ~/.ssh/rc (on the server!).

Note that you do not need to set any environment variables on the server. DISPLAY and XAUTHORITY will automatically be set to their proper values. If you run ssh and DISPLAY is not set, it means ssh is not forwarding the X11 connection.

To confirm that ssh is forwarding X11, check for a line containing Requesting X11 forwarding in the ssh -v -X output. Note that the server won't reply either way, a security precaution of hiding details from potential attackers."

Make sure you restart sshd after changing settings to /etc/ssh/sshd_config

cat /var/run/sshd.pid | xargs kill -1