Skip to main content

Create SSH tunel to a running colab notebook

Project description

Colab SSH

Create SSH tunel to a running colab notebook

build_status codecov license

Usage

Create a new Colab notebook with two cell with the following content:

!pip3 install linus_colab_ssh

from colab_ssh import setup_ssh, loop_forever

public_key = 'https://gist.githubusercontent.com/lamhoangtung/4fca574da11ef45869bdfea8062417b5/raw/320893c60a5a150f61481899201664761136fae7/authorized_keys'
setup_ssh(public_key)
loop_forever()

Run it, after about 2 minutes, you will see a command to SSH to the Colab notebook instance like this:

ssh -o UserKnownHostsFile=/dev/null -o VisualHostKey=yes -oProxyCommand="cloudflared access ssh --hostname %h" root@newspapers-tn-funky-lime.trycloudflare.com

In order to use this command, you will need to install cloudflared from here

Then voila ;)

Disclaimer

This repo contains many of the configuration that I use for my day to day work so it might not be the best for you.

If you had any problems using this, feel free to open an issue. Otherwise, I highly recommend you to fork this repo and did some necessary modification for yourself. Thanks for checking by

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linus_colab_ssh-0.1.tar.gz (9.7 kB view hashes)

Uploaded Source

Built Distribution

linus_colab_ssh-0.1-py3-none-any.whl (11.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page