Skip to content

Instantly share code, notes, and snippets.

@ejach
Last active September 20, 2022 14:55
Show Gist options
  • Save ejach/386b129a5a21613d6917d6940150a988 to your computer and use it in GitHub Desktop.
Save ejach/386b129a5a21613d6917d6940150a988 to your computer and use it in GitHub Desktop.
Shortcut for making a reverse tunnel on `localhost:7777`
#!/bin/bash
if [[ ! -z $1 ]]; then
while getopts i:h:p: option
do
case "${option}" in
i) identity=${OPTARG};;
h) host=${OPTARG};;
p) port=${OPTARG};;
esac
done
ssh -i ~/.ssh/${identity} -p ${port} -N -D localhost:7777 ${host} -vvv
else
echo "Incorrect input, please try again."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment