Linux – How to run a program remotely via SSH but display locally

linuxsshx-server

Is it possible for me to SSH to another server in Linux (Ubuntu), run a program there but display it locally?

And is it possible for me to SSH to another server in my terminal,
and configure it so that all graphical programs (Firefox, Emacs) run in that SSH session will be displayed locally?

Best Answer

By adding the "-Y" flag to the ssh command, the display will automatically be redirected to your local computer.

ssh -Y <remoteip>

Then, if you start Firefox (or any other X application) in that ssh session, it will be displayed locally. (If you have a xserver running locally of course)