30

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?

michael
  • 6,215

5 Answers5

34

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)

Nifle
  • 34,998
5

You are looking to do remote X. This is a good mini HOWTO.

4

You can also use compression when using X-forwarding:

ssh $HOSTNAME -CY $PROCESS
usered
  • 5
3

You might also want to try this:

ssh <hostname> -X <program-name or its full path>
Xolve
  • 490
0

There is another option which is usually more desirable. X11-forwarding is still kinda slow and the programs crash when your wifi connection just dropped AGAIN. With my remote-work project you can configure any app, say gedit, to open the file with a local gedit-instance from within the ssh session. All you have to do is add REMOTE_EXEC_PRODUCER_ADD_APPS gedit in the remote bashrc, enter gedit foo and the gedit installed on your laptop will open the remote file via sshfs. See also https://github.com/tycho-kirchner/remote-work

spawn
  • 121
  • 3