Whatever the scenario, Linux and other operating systems running an X server have the ability to forward a graphical application through SSH. Following a few simple steps, you can run a remote application in all of its full graphical glory. Note: if you are making multiple SSH connections to your remote machine, you can get your machine to show all active SSH connections.
Installation and Setup
Before you begin, you need to make sure that the SSH client and server are installed on the correct computers. The host computer that has the actual running applications needs to have an SSH server running. To install SSH, you need to run the following command on both your client and server machines: The other important preliminary step is to make sure both computers are connected to a network and that you can reach them via SSH. If the computers are in the same building, it will be easy. If not, you may have to configure the host computer to receive SSH connections through the firewall. See your router’s documentation for the correct method of port forwarding.
Connecting to a Remote Server
This tells SSH to start the X-forwarding server calls to the client computer. Note: if you are using KDE, you will need to add “dbus-launch” before KDE applications. For example: dbus-launch kwrite &. Other applications that do not require D-Bus should work without it.
Automating and Securing SSH X-Forwarding
You should now be able to run remote X applications at will. This can be very helpful if, for example, you are running a computer with a very small hard drive, no hard drive or even one without a CD-ROM drive, all of which are common with many netbooks and low-cost mini desktops. To automate this process, you could set up SSH public keys to connect without passwords and write an executable script. Also, if you need a full X session forwarded, you can use VNC technology through TigerVNC and x11vnc. As with any network solution, you also need to make sure that your remote server is secure. Using SSH provides a secure connection, but it’s useless if your password is easy to guess and your firewall allows anyone to gain access to it. Once you have a secure plan in place, remote X forwarding is an excellent way to load remote applications on demand and manage remote machines. The possibilities are only as limited to your imagination and the speed of your network connection. Image credit: Unsplash. All alterations and screenshots by Ramces Red. Aside from that, you can also force SSH X-Forwarding in Wayland systems by replacing the “-X” flag with “-Y.” However, this alternative option is incredibly insecure. You need to make sure that you are in a closed, private network when you use this particular flag.