X11 Forward
X11 is a window system. [Wikipedia: X Window System].
SSH has the option to forward UI from remote to local. Such as open server's firefox on localhost (although would be pretty slow). Forwarding terminal windows and editors, and simulation windows like ROS Viz may be practical examples.
ssh -X <user>@<server>
The -X
flag enables X11 forward.
Prerequisite
On the server side, it must also be enabled by setting X11Forwarding yes
in /etc/ssh/sshd_config
. Make sure you have the permission to edit the file and restart ssh service after modification.
Linux OS with X11 as the window system can run the command directly, on Mac and Windows whose window system isn't X11, extra softwares need to be installed.
Usage
ssh -X <user>@<server>
to establish connection.
Run xclock
, gedit
or any UI app that you know is installed on the server. A window should pop up on your local computer.
Trusted X11 Forwarding
-X
is untrusted. -Y
is trusted.
In untrusted x11 forwarding, one extra step is performed before starting.
Read What You Need to Know About X11 Forwarding for more details.