Connect to Another OpenClaw
What This Skill Does
Provides a unified interface to connect to a remote OpenClaw server via SSH, perform health checks, manage skills, and troubleshoot common issues like port conflicts.
Prerequisites
- 1. SSH Access to the remote machine:
- SSH private key file (recommended) OR password access
- Remote user must have sudo/root privileges
- Remote machine must have OpenClaw installed
- 2. SkillHub on both local and remote (for skill sync)
- Network connectivity (port 22 SSH)
Primary Workflow
1. Connect and Check Status
CODEBLOCK0
Important: Replace <your-remote-host> with your actual remote server IP or domain (e.g., 192.168.1.100 or myserver.com). This is a required placeholder.
This will:
- - Test SSH connectivity
- Check OpenClaw Gateway status
- List active channels (QQBot, etc.)
- Show recent sessions
2. Fix Common Issues
CODEBLOCK1
Automatically:
- - Detect port conflicts on gateway port (default 18790)
- Kill conflicting processes (SSH tunnels, test services)
- Restart OpenClaw gateway
- Verify recovery
3. Sync Skills
CODEBLOCK2
4. Send Message via Remote QQBot
CODEBLOCK3
Commands Reference
| Command | Description |
|---|
| INLINECODE3 | Full health check of remote OpenClaw |
| INLINECODE4 |
Auto-fix port 18790 conflicts |
|
diff | Compare local vs remote skills |
|
sync-to-local | Install remote-only skills to local |
|
sync-to-remote | Push local-only skills to remote |
|
list-skills | List all skills on remote |
|
list-channels | List configured channels |
|
list-sessions | Show active sessions |
|
tail-logs | Tail OpenClaw logs filtered by channel |
|
test-connection | Simple SSH test |
Configuration
The skill uses these environment variables (optional):
| Variable | Purpose | Default |
|---|
| INLINECODE13 | Path to SSH private key | INLINECODE14 |
| INLINECODE15 |
Remote username |
root |
|
CONNECT_OPENCLAW_PORT | SSH port |
22 |
|
CONNECT_OPENCLAW_GATEWAY_PORT | Remote OpenClaw port |
18790 |
You can also pass these as CLI flags:
CODEBLOCK4
Examples
Quick diagnostic
CODEBLOCK5
Fix port conflict and restart
CODEBLOCK6
Compare skills before syncing
CODEBLOCK7
One-way sync (remote → local)
connect-openclaw --host <your-remote-host> --action sync-to-local
Installation
If not already installed, run:
CODEBLOCK9
Or clone this repository to ~/.openclaw/workspace/skills/Connect_to_another_openclaw/.
Requirements
- - Python 3.9+ (or Node.js version if implemented in JS)
- INLINECODE22 (Python SSH library) or native
ssh command - Access to remote shell
Troubleshooting
| Problem | Solution |
|---|
| INLINECODE24 | Check key permissions (chmod 600), network, and INLINECODE26 |
| INLINECODE27 |
Install SkillHub on remote first |
|
Permission denied | Ensure remote user has sudo/root and correct key |
|
Port still in use after fix | Manually check with
lsof -i :18790 and kill processes |
Notes
- - Always test with
--action test-connection first - INLINECODE32 will kill processes matching
ssh -N.*18790 and INLINECODE34 - Skill sync uses SkillHub CLI; ensure it's installed on both sides
- For safety,
sync-to-remote prompts before each installation (use --yes to auto-confirm)
Version: 1.0.0
Author: 小李 (基于 2026-03-28 实践经验)
License: MIT
技能名称: Connecttoanother_openclaw
详细描述:
连接到另一个 OpenClaw
此技能的功能
提供一个统一接口,通过 SSH 连接到远程 OpenClaw 服务器,执行健康检查、管理技能,并排查端口冲突等常见问题。
前提条件
- 1. SSH 访问远程机器:
- SSH 私钥文件(推荐)或密码访问
- 远程用户必须具有 sudo/root 权限
- 远程机器必须已安装 OpenClaw
- 2. 本地和远程均需安装 SkillHub(用于技能同步)
- 网络连接(端口 22 SSH)
主要工作流程
1. 连接并检查状态
bash
connect-openclaw --host
--action status
重要:将 替换为实际的远程服务器 IP 或域名(例如 192.168.1.100 或 myserver.com)。这是一个必需的占位符。
此命令将:
- - 测试 SSH 连接
- 检查 OpenClaw 网关状态
- 列出活动通道(QQBot 等)
- 显示最近的会话
2. 修复常见问题
bash
connect-openclaw --host --action fix-port
自动执行:
- - 检测网关端口(默认 18790)上的端口冲突
- 终止冲突进程(SSH 隧道、测试服务)
- 重启 OpenClaw 网关
- 验证恢复情况
3. 同步技能
bash
查看差异
connect-openclaw --host --action diff
将远程缺失的技能安装到本地
connect-openclaw --host --action sync-to-local
将本地缺失的技能安装到远程(如果远程有 SkillHub)
connect-openclaw --host --action sync-to-remote
4. 通过远程 QQBot 发送消息
bash
connect-openclaw --host --action send-qqbot \
--session agent:main:qqbot:direct:... \
--message 来自本地 OpenClaw 的问候
命令参考
| 命令 | 描述 |
|---|
| status | 远程 OpenClaw 的全面健康检查 |
| fix-port |
自动修复端口 18790 冲突 |
| diff | 比较本地与远程技能 |
| sync-to-local | 将远程独有的技能安装到本地 |
| sync-to-remote | 将本地独有的技能推送到远程 |
| list-skills | 列出远程所有技能 |
| list-channels | 列出已配置的通道 |
| list-sessions | 显示活动会话 |
| tail-logs | 按通道筛选跟踪 OpenClaw 日志 |
| test-connection | 简单的 SSH 测试 |
配置
此技能使用以下环境变量(可选):
| 变量 | 用途 | 默认值 |
|---|
| CONNECTOPENCLAWSSHKEY | SSH 私钥路径 | ~/.ssh/idrsa |
| CONNECTOPENCLAWUSER |
远程用户名 | root |
| CONNECTOPENCLAWPORT | SSH 端口 | 22 |
| CONNECTOPENCLAWGATEWAY_PORT | 远程 OpenClaw 端口 | 18790 |
您也可以将这些作为 CLI 标志传递:
bash
connect-openclaw --host example.com --user admin --key ~/.ssh/mykey.pem --action status
示例
快速诊断
bash
connect-openclaw --host --action status
修复端口冲突并重启
bash
connect-openclaw --host --action fix-port
同步前比较技能
bash
connect-openclaw --host --action diff
单向同步(远程 → 本地)
bash
connect-openclaw --host --action sync-to-local
安装
如果尚未安装,请运行:
bash
skillhub install Connecttoanother_openclaw
或者将此仓库克隆到 ~/.openclaw/workspace/skills/Connecttoanother_openclaw/。
要求
- - Python 3.9+(如果用 JS 实现则为 Node.js 版本)
- paramiko(Python SSH 库)或原生 ssh 命令
- 远程 shell 访问权限
故障排除
| 问题 | 解决方案 |
|---|
| SSH 连接失败 | 检查密钥权限(chmod 600)、网络和 authorized_keys |
| 远程未找到 SkillHub |
先在远程安装 SkillHub |
| 权限被拒绝 | 确保远程用户具有 sudo/root 权限和正确的密钥 |
| 修复后端口仍被占用 | 使用 lsof -i :18790 手动检查并终止进程 |
注意事项
- - 始终先使用 --action test-connection 进行测试
- fix-port 会终止匹配 ssh -N.*18790 和 voice-bridge-light 的进程
- 技能同步使用 SkillHub CLI;确保两端均已安装
- 为安全起见,sync-to-remote 在每次安装前会提示(使用 --yes 自动确认)
版本:1.0.0
作者:小李(基于 2026-03-28 实践经验)
许可证:MIT