Skip to content

Instantly share code, notes, and snippets.

@yoelrc88
yoelrc88 / ssh-into-colab.sh
Last active April 29, 2019 17:03 — forked from creotiv/gist:d091515703672ec0bf1a6271336806f0
script to ssh into colab notebook
#Generate root password
import random, string
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20))
#Download ngrok
! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
! unzip -qq -n ngrok-stable-linux-amd64.zip
#Setup sshd
! apt-get install -qq -o=Dpkg::Use-Pty=0 openssh-server pwgen > /dev/null
#Set root password