Skip to content

Instantly share code, notes, and snippets.

@DallasO
Last active September 8, 2019 18:48
Show Gist options
  • Save DallasO/81dc158761065fb569a26e27e7bf2622 to your computer and use it in GitHub Desktop.
Save DallasO/81dc158761065fb569a26e27e7bf2622 to your computer and use it in GitHub Desktop.
Bash function to quickly connect to overthewire.org
# 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