Spaces:
Sleeping
Sleeping
| # 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") | |