Skip to content

Instantly share code, notes, and snippets.

@markwallsgrove
Last active March 15, 2019 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markwallsgrove/34710dfda01640784be9188833ec3c34 to your computer and use it in GitHub Desktop.
Save markwallsgrove/34710dfda01640784be9188833ec3c34 to your computer and use it in GitHub Desktop.
Publically Accessible SSH Port With Ngrok (Ubuntu)
#!/bin/bash
# Create a account at https://ngrok.com/ to use ngrok
if [ -z "$NGROK_AUTHTOKEN" ] && [ ! -f ~/.ngrok2/ngrok.yml ]; then
1>&2 echo "ngrok authentication token missing"
exit 1
fi
apt-get install -y unzip openssh-server
service ssh start
if [ ! -f ngrok ]; then
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
unzip ngrok-stable-linux-amd64.zip
rm -rf ngrok-stable-linux-amd64.zip
fi
if [ ! -f ~/.ngrok2/ngrok.yml ]; then
./ngrok authtoken $NGROK_AUTHTOKEN
fi
./ngrok tcp 22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment