Last active
September 20, 2022 14:55
-
-
Save ejach/386b129a5a21613d6917d6940150a988 to your computer and use it in GitHub Desktop.
Shortcut for making a reverse tunnel on `localhost:7777`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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