In this video, you'll learn about remote access protocols.
So X-Forwarding is a remote access protocol.
Now the thing with this is that it is old, because X-Forwarding is only useful in X11
based environments.
In these environments, you could forward graphical applications remotely and show their screens
on the current host using SSH minus UPSCORE-X, followed by the IP address and the name of
the applications that you wanted to run.
On Wayland, that doesn't work anymore, because Wayland doesn't include a built-in network
protocol.
And also for security reasons, it doesn't allow remote applications to draw screens
on it by default.
As a solution for backward compatibility, the XORG X11 server XWayland package can be
installed on the local machine to provide a local X server within Wayland.
Because without X server, there is no way that the graphical application can draw its
screens.
On the remote server, the XORG X11 XALT package needs to be installed to handle the forwarding
correctly.
And also ensure that in secure shell configuration, the options forward X11 is yes and forward
X11 trusted is yes are set on the client as well as on the remote.
Notice that X forwarding only works on applications that are developed for X11, and not for Wayland
applications.
And that means that depending on your distribution current configuration, you may have a hard
time finding the right application.
Some classical X11 applications are XICE and GNOME terminals, so that is what you could
try.
All right, I'm going to show you how to forward graphical sessions.
So I have two servers, one of them is remote, that's where the graphical application is
installed.
That's where you need dnf install XORG X11 server XWayland.
That is going to install the X11 compatible server for Wayland.
Next you need to tweak sshd-config, the secure shell server configuration, with the parameter
X11 forwarding yes.
Don't forget to restart the sshd process.
And then on local, you need to install XORG X11 XALT, because otherwise the remote client
is not authorized to draw its screens on the local machine.
Make sure you set forward X11 yes and forward X11 trusted also to yes in etc ssh ssh-config.
And then from local, you can use ssh-y user at remote server GNOME calculator.
To be considered, at the moment that I'm recording this, GNOME calculator is still an X11 compatible
application.
It is very important that you have an X11 compatible application and not a Wayland application,
because they won't work.
So here we have the remote server, I'm going to use sudo dnf install XORG-X11-server and
XWayland.
And next I need to go into etc ssh sshd-config to apply.
Then we need to tweak the sshd-config and make sure it has X11 forwarding set to yes.
Now systemctl restart sshd to restart the ssh server, and we should be OK.
So now we are on the local host, and on the local host, I need sudo dnf install XORG-X11-XALT,
which is taking care of proper authentication.
Next, I need to take care of the ssh-client configuration in etc ssh ssh-config, not to
be confused with sshd-config, which is for the server.
And then we have forward X11.
Forward X11 needs to be set to yes.
Next, I also need forward X11 truss set is yes.
And we don't have to install anything because it's the ssh-client installation.
I'm going to use ssh-y, student at remote, and let's use GNOME calculator.
So I need to authenticate as user student, enter the password, and there we go.
We can see the GNOME calculator.
And that is how you forward graphical applications in the old X11 compatible way.