From: eostre Date: Thu, 3 Sep 2020 20:48:08 +0000 (-0400) Subject: start X-Git-Url: https://vcs.fsf.org/?p=eostre.git;a=commitdiff_plain;h=c5bafd5bf8655da2dd1bcd1bf7c830ac413c8903;hp=54b48a56076f1007d558508a0028660536f722bf start --- diff --git a/meatviewer/client.sh b/meatviewer/client.sh new file mode 100644 index 0000000..4745489 --- /dev/null +++ b/meatviewer/client.sh @@ -0,0 +1,29 @@ +#!/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@proxy is just your username at the remote proxy machine +" +} + +[ -n $@ ] || print_usage + +PORT_TO_FORWARD=$1 +REMOTE_PORT=$2 +PROXY=$3 + +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