File size: 640 Bytes
5e0532d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Install colab_ssh
try:
    import colab_ssh
except ImportError:
    import subprocess
    subprocess.check_call(["pip", "install", "colab_ssh", "--upgrade"])
    from colab_ssh import launch_ssh_cloudflared

# Launch SSH via Cloudflared
# This will output a command like:
# Host google_colab_ssh
#     HostName ...
#     User root
#     Port ...
# Copy that output to your local ~/.ssh/config
print("Setting up SSH...")
launch_ssh_cloudflared(password="ora123")
print("\n[Done] Copy the 'Host google_colab_ssh' block above to your local ~/.ssh/config")
print("Then connect via VS Code: Remote-SSH -> Connect to Host -> google_colab_ssh")