一键导入
oc-ssh-fix
Use when the user has SSH connection issues, or says 'SSH 連不上', 'connection failed', '連線失敗', 'ssh fix', 'SSH 修復', 'SSH 斷了', 'can't connect'.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when the user has SSH connection issues, or says 'SSH 連不上', 'connection failed', '連線失敗', 'ssh fix', 'SSH 修復', 'SSH 斷了', 'can't connect'.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when the user wants to add a new bot/agent to OpenClaw, or says '加 bot', '新增 agent', 'add agent', 'add bot', '多一個 bot', '再加一個'.
Use when the user has an idea or feature request and wants to explore implementation approaches, or says 'brainstorm', '腦力激盪', '想辦法', 'explore idea', '有個想法', '可不可以做', 'how would we', '怎麼實現'.
Use when the user asks to search, browse, install, or audit ClawHub skills, or says '找 skill', 'search clawhub', '裝 skill', 'install skill', '安全檢查', 'audit skill', 'suggest skills', '推薦 skill', or wants to add new capabilities from ClawHub.
Use when the user asks to deploy, push, or sync openclaw.json to the remote host, or says '部署設定', '推設定', or wants to apply local config changes to the remote.
Use when the user asks to check remote host health, OpenClaw service status, or recent gateway errors, or says '檢查狀態', 'health check', '遠端狀態', '龍蝦狀態'.
Use when the user wants to pause or shelve current work due to a blocker, or says 'park', '暫存', '先放著', 'blocker', '等一下再做'.
| name | oc-ssh-fix |
| description | Use when the user has SSH connection issues, or says 'SSH 連不上', 'connection failed', '連線失敗', 'ssh fix', 'SSH 修復', 'SSH 斷了', 'can't connect'. |
執行前讀取 setup.json:
remote.sshAlias(以下以 ${SSH_ALIAS} 表示)remote.sshAliasFallback(以下以 ${SSH_ALIAS_FALLBACK} 表示)remote.host(以下以 ${HOST} 表示)remote.hostFallback(以下以 ${HOST_FALLBACK} 表示)remote.user(以下以 ${REMOTE_USER} 表示)按優先順序嘗試:
# 1. 主要 alias
ssh -o ConnectTimeout=5 ${SSH_ALIAS} 'echo ok' 2>&1
成功 → 回報「連線正常」並結束。
# 2. Fallback alias(如有設定)
ssh -o ConnectTimeout=5 ${SSH_ALIAS_FALLBACK} 'echo ok' 2>&1
成功 → 回報「主要連線失敗,但 fallback 可用」,建議該 session 使用 fallback。
# 3. 直接用 IP
ssh -o ConnectTimeout=5 ${REMOTE_USER}@${HOST} 'echo ok' 2>&1
成功 → 回報「SSH alias 設定可能有問題」,進入步驟 3 檢查 SSH config。
ping -c 3 ${HOST}
如果有 fallback IP:
ping -c 3 ${HOST_FALLBACK}
tailscale status
沒跑 → 嘗試啟動:
tailscale up
啟動後重試主要連線。
如果 ping 得到但 SSH 連不上:
讀取本機 ~/.ssh/config,確認:
Host ${SSH_ALIAS} 區塊HostName 是否正確(對應 setup.json 的 remote.host)User 是否正確(對應 setup.json 的 remote.user)ConnectTimeout 是否設定如果有問題 → 提供修正後的 config 區塊,詢問使用者是否要修復。
ls -la ~/.ssh/id_*.pub
ssh-keygen -t ed25519)ssh -o ConnectTimeout=5 -i ~/.ssh/id_ed25519 ${REMOTE_USER}@${HOST} 'echo ok'
如果密碼驗證可以但 key 不行 → 需要重新 ssh-copy-id。
回報找到的問題和已執行/建議的修復,格式:
## SSH 連線診斷
| 檢查項目 | 結果 |
|----------|------|
| 主要連線 (${SSH_ALIAS}) | ✅ / ❌ |
| Fallback 連線 | ✅ / ❌ / N/A |
| 直接 IP 連線 | ✅ / ❌ |
| Ping | ✅ / ❌ |
| Tailscale | ✅ / ❌ / N/A |
| SSH Config | ✅ / ❌ |
| SSH Key | ✅ / ❌ |
建議動作:...