Chapter 12. Remotely accessing an X11-based application
You can remotely launch a graphical X11-based application on a RHEL server and use it from the remote client using X11 forwarding.
This procedure works for legacy X11 applications, that is, applications that support the X11 display protocol.
12.1. Enabling X11 forwarding on the server
Configure a RHEL server so that remote clients can use graphical applications on the server over SSH.
Procedure
Install basic X11 packages:
# dnf install xorg-x11-xauth xorg-x11-fonts-\* xorg-x11-utils dbus-x11
NoteYour applications might rely on additional graphical libraries.
Enable the
X11Forwarding
option in the/etc/ssh/sshd_config
configuration file:X11Forwarding yes
The option is disabled by default in RHEL.
Restart the
sshd
service:# systemctl restart sshd.service
12.2. Launching an application remotely using X11 forwarding
Access a graphical application on a RHEL server from a remote client using SSH.
Prerequisites
- X11 forwarding over SSH is enabled on the server. For details, see Section 12.1, “Enabling X11 forwarding on the server”.
Ensure that an X11 display server is running on your system:
- On RHEL, X11 is available by default in the graphical interface.
- On Microsoft Windows, install an X11 server such as Xming.
- On macOS, install the XQuartz X11 server.
- You have configured and restarted an OpenSSH server. For details, see Configuring and starting an OpenSSH server.
Procedure
Log in to the server using SSH:
[local-user]$ ssh -X -Y remote-server The authenticity of host 'remote-server (192.168.122.120)' can't be established. ECDSA key fingerprint is SHA256:uYwFlgtP/2YABMHKv5BtN7nHK9SHRL4hdYxAPJVK/kY. Are you sure you want to continue connecting (yes/no/[fingerprint])?
Confirm that a server key is valid by checking its fingerprint.
NoteIf you plan to log in to the server on a regular basis, add the user’s public key to the server using the
ssh-copy-id
command.Continue connecting by typing yes.
Warning: Permanently added 'remote-server' (ECDSA) to the list of known hosts.
When prompted, type the server password.
local-user's password: [local-user ~]$
Launch the application from the command line:
[remote-user]$ application-binary
To skip the intermediate terminal session, use the following command:
$ ssh user@server -X -Y -C binary_application