How To: Enable x11 Forwarding with SSH

Just to quickly clear up a misconception, x11 forwarding works just fine with Wayland. Way back in the earliest days, it was agreed that it should retain backwards compatibility with x11 forwarding.

Enable x11 Forwarding With SSH

What is this strange thing, this x11 forwarding?

Perhaps a picture is in order. Check this:

x11 forwarded gedit
This GEdit is actually running on my laptop, forwarded to this desktop.

So, how do you do it? 

Well, first you need to crack open your terminal. To do that, you just press CTRL + ALT + T on your keyboard and your default terminal emulator will open.

Now, in said terminal, I want you to run the following command:

[code]sudo nano /etc/ssh/sshd_config[/code]

Once you have that open, you just need to remove the appropriate asterisk (uncomment it out) for the right line. Look for the line that says:

[code]#X11Forwarding yes[/code]

And change it to:

[code]X11Forwarding yes[/code]

Then save the file by pressing CTRL + X, then Y, and then ENTER.

[code]systemctl restart sshd[/code]

[code]ssh user@host_name.local -X[/code]

To try to make sense of that, if I were to do this connecting to the new MSI laptop, then my command would look just like:

[code]ssh kgiii@kgiii-msi.local -X[/code]

You can also use the IP address, instead of the hostname, just like we discussed in the previous article about SSH. To do that, it looks like this:

[code]ssh user@ip_address -X[/code]

Firefox forwarded over SSH

See? Note the carefully drawn arrow that shows where it was forwarded from. Tada!