Colab SSH
在colab中新建一个init.sh
1
pip install colab_ssh --upgrade
在notebook中:
1
2
# 初始化colab ssh
! bash / content / drive / MyDrive / ssh / init . sh
然后挂载一下云盘
1
2
3
# 挂载云盘
from google.colab import drive
drive . mount ( '/content/drive/' )
启动colab-ssh
1
2
3
# Install colab_ssh on google colab
from colab_ssh import launch_ssh_cloudflared , init_git_cloudflared
launch_ssh_cloudflared ( password = "colab_passwd" ) #这里改成你自己的密码
点击
然后下载对应的客户端
然后将这个程序存放到本地中的某个路径 ,假设是V:\colab\cloudflared-windows-amd64.exe
VS code
首先确保安装了插件Remote - SSH
配置文件按colab给定的内容写,然后把路径替换,注意是绝对路径
1
2
3
4
5
Host *.trycloudflare.com
HostName %h
User root
Port 22
ProxyCommand V:\colab\cloudflared-windows-amd64.exe access ssh --hostname %h
然后复制这一串
作为连接命令去使用remote连一下就好了
Licensed under CC BY-NC-SA 4.0