A handy SSH Tunneling script. Useful for many remote work tasks, for example securing a remote desktop connection.

#!/usr/bin/env bash

if [ $# -eq 2 ]; then
  echo "Go to: http://localhost:$2, which is connected to http://$1:$2"
  ssh -N -L $2:localhost:$2 $1
elif [ $# -eq 3 ]; then
  echo "Go to: http://localhost:$2, which is connected to http://$1:$3"
  ssh -N -L $2:localhost:$3 $1
else
  echo "Usage: ./$0 remote_host local_port [remote_port]"
  echo "Received $# arguments instead"
  exit -1
fi

(page source)