Using X11 Forwarding to Load Remote Graphical Applications
X11 forwarding lets a user start graphical applications installed on a remote Linux system so that they display within the desktop environment of the local system. The remote system doesn't need to have an X11 server or graphical desktop environment running, but the local system must have an X11 compatible service running.
Server-side Configuration
-
Change the
/etc/ssh/sshd_configfile to enable X11 forwarding. On the server, verify the following parameters:- X11Forwarding
-
Allows X11 forwarding. When omitted, the default is
no. To enable X11 forwarding, add an entry that sets the value for this parameter toyes.
-
If you edit the configuration file, you must restart the service for the change to take effect:
sudo systemctl restart sshd -
The remote system must also can run X11 applications and authenticate X11 sessions. The
xorg-x11-xauthpackage is required for this purpose.dnf install xorg-x11-xauthIf you have never run a graphical application on the remote server, the first time that you connect to the remote server using X11 forwarding, a warning message is displayed:/usr/bin/xauth: file /home/user/.Xauthority does not existYou can ignore this warning as the
.Xauthorityfile is automatically created.
Client Configuration
-
Use the
-Yoption with the SSH client when you connect to a remote server:ssh -Y user@server1.example.com -
Run a graphical application over the SSH connection by typing the command directly from the SSH terminal. For example, if
geditis installed on the remote system, you might run the following command:gedit &Tip:
Use the
&operator, as shown in the preceding example, to start process in the background so that the terminal remains available to you.