script that sets up a reverse ssh tunnel, and optionally starts a VNC server as well if the START_VNC environment variable is not null
PORT is the port that your techy needs access to. In general, for graphical issues use 5900 and for command-line issues use 22
REMOTE_PORT is the port that you'll get on the proxy server, any number over 1000 works as long as you and your techy plug in the same number
- user@proxy is just your username at the remote proxy machine
+ USER is just your username at the remote proxy machine, if left blank it is assumed to be the same as your username on your local machine
"
}
PORT_TO_FORWARD=$1
REMOTE_PORT=$2
-PROXY=$3
+USER=${3:-$(whoami)}
-ssh -T -R $REMOTE_PORT:localhost:$PORT_TO_FORWARD $PROXY
-
-# quick code that starts up a VNC server for us, if we like
-# this won't run if START_VNC is set
-[ -n $START_VNC ] || exit
-DISPLAY="${DISPLAY:-:0}"
-# -forever - x11vnc won't exit after the first disconnect
-# -shared - allow multiple clients to share the same screen
-# -localhost - only allow connections that are tunneled through localhost
-x11vnc -forever -shared -localhost
+ssh -T -R $REMOTE_PORT:localhost:$PORT_TO_FORWARD $USER