SSH 连接
用本机 SSH 客户端连接 GPU 实例。
#生成密钥
Linux / macOS
ssh-keygen -t ed25519 -C "your@email"
cat ~/.ssh/id_ed25519.pub
chmod 600 ~/.ssh/id_ed25519
Windows(PowerShell)
ssh-keygen -t ed25519 -C "your@email"
Get-Content $env:USERPROFILE/.ssh/id_ed25519.pub
只把公钥上传到控制台;私钥留在本机。
#连接实例
创建或编辑实例时勾选公钥。实例可连接后:
ssh -i ~/.ssh/id_ed25519 -p <端口> <用户>@<主机>
#连不上时
- 1. 确认实例仍在运行,未释放。
- 2. 核对控制台最新的主机 / 端口 / 用户名。
- 3. 确认用的是匹配的私钥,权限约为
600。 - 4. 本机可先
ssh -v看卡在哪一步。
当前不提供网页在线终端,请用本机 SSH 客户端。
#断线续跑
tmux new -s train
# 运行任务后:Ctrl+B,再按 D
tmux attach -t train
实例释放或余额不足回收后,进程与数据都会消失,请先备份。