用一台 Pad,随时接管 Mac 与 GPU 集群 A real remote-development endpoint, built with Termux and bidirectional SSH

近处走局域网,远处走腾讯云;需要公司网络时走 VPN。入口不变,路径自动选择。

现在的链路 · The new chain

Pad 不再只是一个 SSH 客户端,而是一台能被双向访问的 Linux 终端。

Termux turns the tablet into an addressable Unix endpoint, not just a screen.

📱 OPPO Pad · Termuxzsh、SSH、会话切换和本地文件都在这里。
同一局域网直接连接;在外面时经腾讯云中继
💻 Mac · 工作与 Agent 中心Codex、git、项目文件和持久 tmux 会话运行在这里。
Mac 已有的公司网络与 SSH 配置
🖥️ GPU 集群NRT、Poly、Prenyx 等训练与推理环境。
Pad 开启 Sing-box 时可以直连集群;没有 VPN 时则自动借用 Mac 的网络。无论走哪条路,常用命令保持不变。

Pad 怎么连接 · From the Pad

进入 Mac

普通 Shell、恢复工作现场或直接启动 Codex。

MAC mac-cc CODEX

进入服务器

SSH alias 已同步;VPN 可用就直连,否则经过 Mac。

NRT poly prenyx

自动选路 · One name, two routes

  1. 同一局域网:直连

    Pad 和 Mac 在同一个 Wi-Fi 时,SSH 直接在本地网络传输,延迟最低。

  2. 人在外面:腾讯云中继

    Mac 和 Pad 都主动建立反向 SSH 隧道。云端端口只绑定到本机回环地址,不直接暴露给公网。

  3. 入口始终不变

    连接命令先探测局域网,失败后自动切到腾讯云;不需要记 IP、端口或当前网络状态。

Mac 如何反向连接 Pad · Back to the Pad

Mac 和运行在 Mac 上的 Agent 使用同一个入口。

The same alias works for a human shell, automation, and file transfer.

# 进入 Pad;局域网优先,腾讯云兜底
ssh pad

# 在 Pad 执行一条独立命令
ssh pad 'command'

# 双向传文件
scp local-file pad:~/
scp pad:~/remote-file .
这让 Agent 能直接检查 Pad 状态、读取最新截图、同步文件或打开测试页面。Pad 不再是链路末端,而是工作流的一部分。

只需要记住 · The essentials

入口作用
mac-cc从 Pad 回到 Mac 上名为 cc 的 tmux 工作现场
CODEX在 Mac 上运行 Codex,Pad 只负责显示和输入
NRT / poly连接 GPU 集群,自动选择直连或经 Mac
ssh pad从 Mac 或 Agent 反向进入 Pad