Skip to content

Instantly share code, notes, and snippets.

@DarinDev1000
Created February 12, 2019 05:18
Show Gist options
  • Save DarinDev1000/1a7ff4e868556c6a926d0364e3b12acb to your computer and use it in GitHub Desktop.
Save DarinDev1000/1a7ff4e868556c6a926d0364e3b12acb to your computer and use it in GitHub Desktop.
Script to setup ngrok for ssh connection on Linux
#!/bin/bash
# ngrok-setup-script.sh
#
# Script to setup ngrok for ssh connection
#
# For Linux
#
# Requires wget, unzip, and screen installed
echo 'Create and ngrok account at ngrok.com'
echo 'Starting ngrok setup'
# Make ngrok directory
mkdir ~/ngrok
cd ~/ngrok
# Download ngrok
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
# Unzip ngrok
unzip https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
# Authenticate with ngrok account
echo 'Input your ngrok account token'
read TOKEN
./ngrok authtoken $TOKEN
# create screen session
screen -S ngrok
# How to detach screen session
echo 'Ctr + a + d to detach session'
# Start ngrok server
./ngrok tcp 22
# List screen sessions
screen -list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment