#!/bin/bash -xe function print_usage { echo \ " usage: $0 PORT REMOTE_PORT user@proxy 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 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 " } [ -n $@ ] || print_usage PORT_TO_FORWARD=$1 REMOTE_PORT=$2 USER=${3:-$(whoami)} ssh -T -R $REMOTE_PORT:localhost:$PORT_TO_FORWARD $USER