OpenClawSkills
GitHub
Gateway / Operations • 5分で読める

リモート Gateway 設定

OpenClaw.app からリモート Gateway に接続するための SSH トンネル設定。

OpenClaw.app は SSH トンネルを使用してリモートゲートウェイに接続します。このガイドでは設定方法を説明します。

Tutorial.step

Overview

Terminal
┌─────────────────────────────────────────────────────────────┐
│                        Client Machine                          │
│                                                              │
│  OpenClaw.app ──► ws://127.0.0.1:18789 (local port)           │
│                     │                                        │
│                     ▼                                        │
│  SSH Tunnel ────────────────────────────────────────────────│
│                     │                                        │
└─────────────────────┼──────────────────────────────────────┘
                      │
                      ▼
┌─────────────────────────────────────────────────────────────┐
│                         Remote Machine                        │
│                                                              │
│  Gateway WebSocket ──► ws://127.0.0.1:18789 ──►              │
│                                                              │
└─────────────────────────────────────────────────────────────┘
Tutorial.step

クイックセットアップ

#

Tutorial.step

ステップ 1:SSH 設定を追加

''~/.ssh/config'' を編集して追加します:

Ssh
Host remote-gateway
    HostName '<REMOTE_IP>'          # e.g., 172.27.187.184
    User '<REMOTE_USER>'            # e.g., jefferson
    LocalForward 18789 127.0.0.1:18789
    IdentityFile ~/.ssh/id_rsa

''<REMOTE_IP>'' と ''<REMOTE_USER>'' を自分の値に置き換えます。

#

Tutorial.step

ステップ 2:SSH キーをコピー

公開キーをリモートマシンにコピーします(パスワードを 1 回入力):

Bash
ssh-copy-id -i ~/.ssh/id_rsa '<REMOTE_USER>'@'<REMOTE_IP>'

#

Tutorial.step

ステップ 3:ゲートウェイトークンを設定

Bash
launchctl setenv OPENCLAW_GATEWAY_TOKEN "'<your-token>'"

#

Tutorial.step

ステップ 4:SSH トンネルを開始

Bash
ssh -N remote-gateway &

#

Tutorial.step

ステップ 5:OpenClaw.app を再起動

Bash
open /path/to/OpenClaw.app

アプリは SSH トンネル経由でリモートゲートウェイに接続します。

Tutorial.step

トラブルシューティング

トンネルが実行中か確認します:

Bash
ps aux | grep "ssh -N remote-gateway" | grep -v grep
lsof -i :18789

トンネルを再起動します:

Bash
launchctl kickstart -k gui/$UID/bot.molt.ssh-tunnel

トンネルを停止します:

Bash
launchctl bootout gui/$UID/bot.molt.ssh-tunnel

--- |

ReferenceGatewayRemoteGatewayReadmePage.step08.item1

ReferenceGatewayRemoteGatewayReadmePage.step08.item2

ReferenceGatewayRemoteGatewayReadmePage.step08.item3

ReferenceGatewayRemoteGatewayReadmePage.step08.item4

OpenClaw.app はクライアントマシンの ''ws://127.0.0.1:18789'' に接続します。SSH トンネルはその接続をゲートウェイが実行されているリモートマシンのポート 18789 に転送します。