Google colab SSH connector
Connect to Google colab via ssh easily
What is Colab-ssh
Colab-ssh is a light-weight library that enables you to connect to a Google Colab virtual machine using an SSH tunnel.
User interface is still required in order to create the Colab virtual machine
To install Colab-ssh library, you need to run this command
pip install colab_ssh --upgrade --user
- Open Google Colab and run this code in one of the code cells
# Install colab_ssh !pip install colab_ssh --upgrade from colab_ssh import launch_ssh, init_git launch_ssh(ngrokToken,password) # Optional: if you want to clone a github repository init_git(githubUrl)
passwordis your ssh password that you want to choose
ngrokTokenis your ngrok token that you can get from here
githubUrlis your github HTTPS clone url (usually ends with
Instead of setting a password, you can access the SSH tunnel using your own pair of keys.
IMPORTANT: For this to work you need to setup your git repository by using the function
How it works ? : We get your public key from the repository passed into the
git_init() function and then we add it to the
authorized_keys file (found in
You need to follow these steps:
- Create a pair of SSH key
- Copy your public key (should be inside the file
- In the root of your github repository, create a folder called
.colab_sshand a file within it called
- Paste your public key inside the file
Using VSCode to connect Google Colab
Once you run the code in the Getting Started section you will notice a message like this
... Successfully running tcp://0.tcp.ngrok.io:XXXX ...
XXXXis the port provided by
You can now open VSCode and add this to your SSH Configuration
Host google_colab_ssh HostName 0.tcp.ngrok.io User root Port XXXX
Make sure you replace XXXX with the port you just obtained
Then connect to the remote
Well for now, try to discover things yourself.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size colab_ssh-0.2.44-py3-none-any.whl (6.9 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size colab_ssh-0.2.44.tar.gz (4.6 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for colab_ssh-0.2.44-py3-none-any.whl