Ubuntu – Setting up remote desktop via ssh? Not actually at the machine but can ssh

remote desktop

I'm not going to be in front of my ubuntu machine for a while but I very much need to be able to remote desktop to it.

In an ssh session, what's the best route to take to set-up and allow certain users to remote desktop to my machine?

Best Answer

One option is to use a little script that tunnels the remote desktop session (using x11vnc) over the ssh,

file: vncoverssh

#!/bin/sh

USERHOST=$1

ssh -f -L 5900:localhost:5900 $USERHOST \
  x11vnc -scale 0.5 -safer -localhost -nopw -once -display :0 \
  && sleep 5 \
  && vncviewer -encodings "tight" localhost:0

This can then be called using

vncoverssh USER@HOST

This script can be modified to store the user and host name if desired.

Related Question