Skip to content

Instantly share code, notes, and snippets.

@proguy914629bot
Last active June 1, 2022 09:48
Show Gist options
  • Save proguy914629bot/5e745d1afa3399adc599724f683fe716 to your computer and use it in GitHub Desktop.
Save proguy914629bot/5e745d1afa3399adc599724f683fe716 to your computer and use it in GitHub Desktop.
Google Colab SSH Access
import os
import getpass
from google.colab import drive
drive.mount('/content/gdrive/')
os.system("wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip")
os.system("unzip -qq -n ngrok-stable-linux-amd64.zip")
print("Get your authtoken from https://dashboard.ngrok.com/auth")
authtoken = getpass.getpass()
get_ipython().system_raw('./ngrok authtoken $authtoken && ./ngrok tcp 22 &')
print("SSH Setup Complete! Please visit https://dashboard.ngrok.com/status to view the URL.")
print("You can SSH by doing something like:")
print("ssh root@<url> -p <port>")
print("Happy Coding!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment