Last active
September 8, 2019 18:48
-
-
Save DallasO/81dc158761065fb569a26e27e7bf2622 to your computer and use it in GitHub Desktop.
Bash function to quickly connect to overthewire.org
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
# Add this function to your ~/.bash_alises | |
# Or ~/.bash_secrets if you've looked at my other Gists ;) | |
# overthewire.org | |
# otw game level [port] | |
# otw bandit 0 | |
otw () { | |
if [ $# == 0 ]; then | |
echo "SSH to an OverTheWire wargame" ; | |
echo " Usage: ${FUNCNAME[ 0 ]} game level [port]" ; | |
echo " Example: ${FUNCNAME[ 0 ]} bandit 0" ; | |
else | |
GAME=${1:-bandit} | |
LEVEL=${2:-0} | |
PORT=${3:-2220} | |
ssh -p $PORT $GAME$LEVEL@$GAME.labs.overthewire.org | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment