Last active
March 15, 2019 10:24
-
-
Save markwallsgrove/34710dfda01640784be9188833ec3c34 to your computer and use it in GitHub Desktop.
Publically Accessible SSH Port With Ngrok (Ubuntu)
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/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