/ Published in: Bash
This script opens an SSL tunnel between a source host and a target host.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/env bash if [ -z "$1" -o "$1" = "-h" ]; then echo "$(basename $0): [ [SOURCE_HOST [SOURCE_PORT [TARGET_HOST [TARGET_PORT [USERNAME] ] ] ] ] ]" exit 0 fi SOURCE_HOST=${1:-0.0.0.0} SOURCE_PORT=${2:-7722} TARGET_HOST=${3:-localhost} TARGET_PORT=${4:-22} USERNAME=${5:-bewifi@localhost} DEBUG="" #DEBUG=echo $DEBUG ssh -f "$USERNAME" -L $SOURCE_HOST:$SOURCE_PORT:$TARGET_HOST:$TARGET_PORT -N