Last active
May 28, 2018 21:36
-
-
Save devisnotnull/e13a0fc59738f7d99c71a818ae2b7685 to your computer and use it in GitHub Desktop.
SSH port forward
This file contains hidden or 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/sh | |
# Remote ARG1 | |
# Remote port $ARG2 | |
# Local port $ARG3 | |
if [ $# -ne 3 ] ; then | |
echo 'Invalid aruments provided, Example ./cli.sh 192.158.1.1 5900 5900' | |
exit 1 | |
fi | |
REMOTE=$1 | |
REMOTE_PORT=$2 | |
LOCAL_PORT=$3 | |
ssh root@$REMOTE -L $REMOTE_PORT:127.0.0.1:$LOCAL_PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment