X11, as I suppose most of you know, is the graphical server used by almost all Linux distributions. This server allows, among other things, forwarding via SSH. This means that it is possible to run graphical applications from a remote machine by exporting the display to our desktop. That is, the application runs on the remote server, but the graphical interface is displayed on our local desktop.
Steps to follow
1.- On the server, edit the file / Etc / ssh / ssh_config and modify the option X11Forwarding so it looks like this:
After this change, it may be necessary to restart the ssh daemon. The way to do this varies according to each Linux distribution. The simplest is to restart the machine.
2.- On the local desktop, log in to the server via SSH using the -X parameter:
ssh -X user @ hostname
Where user is the username used to log into the server and hostname is the IP or alias of the server.
3.- To run an application, you just have to do it from the terminal. For example:
Trusted X11 forwarding
By enabling Trusted X11 forwarding, it is possible to speed up the connection speed a bit, since some steps related to its security are avoided.
In case speed is more important than safety, all that needs to be done is the following:
1.- On the server, edit the file / Etc / ssh / ssh_config and modify the option ForwardX11Trusted so it looks like this:
2.- On the local desktop, log in to the server via SSH using the -Y parameter:
ssh -Y user @ hostname
Compressed X11 forwarding
In those scenarios where the connection between the server and the client is not the best, it is possible to compress the data sent by the server.
To do this, when logging into the server via SSH, add the -C parameter:
ssh -X -C user @ hostname