{"id":138,"date":"2026-03-21T22:47:19","date_gmt":"2026-03-21T14:47:19","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/gateway-remote-gateway-readme\/"},"modified":"2026-03-21T23:28:56","modified_gmt":"2026-03-21T15:28:56","slug":"gateway-remote-gateway-readme","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/gateway-remote-gateway-readme\/","title":{"rendered":"\u8fdc\u7a0b \u7f51\u5173 \u7f51\u5173\u8bbe\u7f6e"},"content":{"rendered":"<h1>\u8fdc\u7a0b Gateway \u7f51\u5173 \u7f51\u5173\u8bbe\u7f6e<\/h1>\n<h1>\u4f7f\u7528\u8fdc\u7a0b Gateway \u7f51\u5173 \u7f51\u5173\u8fd0\u884c OpenClaw.app<\/h1>\n<p>OpenClaw.app \u4f7f\u7528 SSH \u96a7\u9053\u8fde\u63a5\u5230\u8fdc\u7a0b Gateway \u7f51\u5173 \u7f51\u5173\u3002\u672c\u6307\u5357\u5411\u4f60\u5c55\u793a\u5982\u4f55\u8bbe\u7f6e\u3002<\/p>\n<h2>\u6982\u8ff0<\/h2>\n<pre><code>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                        Client Machine                          \u2502\n\u2502                                                              \u2502\n\u2502  OpenClaw.app \u2500\u2500\u25ba ws:\/\/127.0.0.1:18789 (local port)           \u2502\n\u2502                     \u2502                                        \u2502\n\u2502                     \u25bc                                        \u2502\n\u2502  SSH Tunnel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2502\n\u2502                     \u2502                                        \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                      \u2502\n                      \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                         Remote Machine                        \u2502\n\u2502                                                              \u2502\n\u2502  Gateway WebSocket \u2500\u2500\u25ba ws:\/\/127.0.0.1:18789 \u2500\u2500\u25ba              \u2502\n\u2502                                                              \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n<\/code><\/pre>\n<h2>\u5feb\u901f\u8bbe\u7f6e<\/h2>\n<h3>\u6b65\u9aa4 1\uff1a\u6dfb\u52a0 SSH \u914d\u7f6e<\/h3>\n<p>\u7f16\u8f91 <code>~\/.ssh\/config<\/code> \u5e76\u6dfb\u52a0\uff1a<\/p>\n<p>&#8220;`ssh  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nHost remote-\u7f51\u5173<br \/>\n    HostName           # e.g., 172.27.187.184<br \/>\n    User             # e.g., jefferson<br \/>\n    LocalForward 18789 127.0.0.1:18789<br \/>\n    IdentityFile ~\/.ssh\/id_rsa<\/p>\n<pre><code>\n\u5c06 `&lt;REMOTE_IP&gt;` \u548c `&lt;REMOTE_USER&gt;` \u66ff\u6362\u4e3a\u4f60\u7684\u503c\u3002\n\n### \u6b65\u9aa4 2\uff1a\u590d\u5236 SSH \u5bc6\u94a5\n\n\u5c06\u4f60\u7684\u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u673a\u5668\uff08\u8f93\u5165\u4e00\u6b21\u5bc6\u7801\uff09\uff1a\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nssh-copy-id -i ~\/.ssh\/id_rsa &lt;REMOTE_USER&gt;@&lt;REMOTE_IP&gt;\n<\/code><\/pre>\n<h3>\u6b65\u9aa4 3\uff1a\u8bbe\u7f6e Gateway \u7f51\u5173 \u7f51\u5173\u4ee4\u724c<\/h3>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nlaunchctl setenv OPENCLAW_GATEWAY_TOKEN &#8220;&#8221;<\/p>\n<pre><code>\n### \u6b65\u9aa4 4\uff1a\u542f\u52a8 SSH \u96a7\u9053\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nssh -N remote-gateway &amp;\n<\/code><\/pre>\n<h3>\u6b65\u9aa4 5\uff1a\u91cd\u542f OpenClaw.app<\/h3>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<\/p>\n<h1>Quit OpenClaw.app (\u2318Q), then reopen:<\/h1>\n<p>open \/path\/to\/OpenClaw.app<\/p>\n<pre><code>\n\u5e94\u7528\u73b0\u5728\u5c06\u901a\u8fc7 SSH \u96a7\u9053\u8fde\u63a5\u5230\u8fdc\u7a0b Gateway \u7f51\u5173\u3002\n\n***\n\n## \u767b\u5f55\u65f6\u81ea\u52a8\u542f\u52a8\u96a7\u9053\n\n\u8981\u5728\u767b\u5f55\u65f6\u81ea\u52a8\u542f\u52a8 SSH \u96a7\u9053\uff0c\u8bf7\u521b\u5efa\u4e00\u4e2a Launch Agent\u3002\n\n### \u521b\u5efa PLIST \u6587\u4ef6\n\n\u5c06\u6b64\u4fdd\u5b58\u4e3a `~\/Library\/LaunchAgents\/bot.molt.ssh-tunnel.plist`\uff1a\n\n```xml  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;!DOCTYPE plist PUBLIC &quot;-\/\/Apple\/\/DTD PLIST 1.0\/\/EN&quot; &quot;http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd&quot;&gt;\n&lt;plist version=&quot;1.0&quot;&gt;\n&lt;dict&gt;\n    &lt;key&gt;Label&lt;\/key&gt;\n    &lt;string&gt;bot.molt.ssh-tunnel&lt;\/string&gt;\n    &lt;key&gt;ProgramArguments&lt;\/key&gt;\n    &lt;array&gt;\n        &lt;string&gt;\/usr\/bin\/ssh&lt;\/string&gt;\n        &lt;string&gt;-N&lt;\/string&gt;\n        &lt;string&gt;remote-gateway&lt;\/string&gt;\n    &lt;\/array&gt;\n    &lt;key&gt;KeepAlive&lt;\/key&gt;\n    &lt;true\/&gt;\n    &lt;key&gt;RunAtLoad&lt;\/key&gt;\n    &lt;true\/&gt;\n&lt;\/dict&gt;\n&lt;\/plist&gt;\n<\/code><\/pre>\n<h3>\u52a0\u8f7d Launch Agent<\/h3>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nlaunchctl bootstrap gui\/$UID ~\/Library\/LaunchAgents\/bot.molt.ssh-tunnel.plist<\/p>\n<pre><code>\n\u96a7\u9053\u73b0\u5728\u5c06\uff1a\n\n* \u767b\u5f55\u65f6\u81ea\u52a8\u542f\u52a8\n* \u5d29\u6e83\u65f6\u91cd\u65b0\u542f\u52a8\n* \u5728\u540e\u53f0\u6301\u7eed\u8fd0\u884c\n\n\u65e7\u7248\u6ce8\u610f\u4e8b\u9879\uff1a\u5982\u679c\u5b58\u5728\u4efb\u4f55\u9057\u7559\u7684 `com.openclaw.ssh-tunnel` LaunchAgent\uff0c\u8bf7\u5c06\u5176\u5220\u9664\u3002\n\n***\n\n## \u6545\u969c\u6392\u9664\n\n**\u68c0\u67e5\u96a7\u9053\u662f\u5426\u6b63\u5728\u8fd0\u884c\uff1a**\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nps aux | grep &quot;ssh -N remote-gateway&quot; | grep -v grep\nlsof -i :18789\n<\/code><\/pre>\n<p><strong>\u91cd\u542f\u96a7\u9053\uff1a<\/strong><\/p>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nlaunchctl kickstart -k gui\/$UID\/bot.molt.ssh-tunnel<\/p>\n<pre><code>\n**\u505c\u6b62\u96a7\u9053\uff1a**\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nlaunchctl bootout gui\/$UID\/bot.molt.ssh-tunnel\n<\/code><\/pre>\n<hr \/>\n<h2>\u5de5\u4f5c\u539f\u7406<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u7ec4\u4ef6<\/th>\n<th>\u529f\u80fd<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>LocalForward 18789 127.0.0.1:18789<\/code><\/td>\n<td>\u5c06\u672c\u5730\u7aef\u53e3 18789 \u8f6c\u53d1\u5230\u8fdc\u7a0b\u7aef\u53e3 18789<\/td>\n<\/tr>\n<tr>\n<td><code>ssh -N<\/code><\/td>\n<td>SSH \u4e0d\u6267\u884c\u8fdc\u7a0b\u547d\u4ee4\uff08\u4ec5\u7aef\u53e3\u8f6c\u53d1\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>KeepAlive<\/code><\/td>\n<td>\u96a7\u9053\u5d29\u6e83\u65f6\u81ea\u52a8\u91cd\u542f<\/td>\n<\/tr>\n<tr>\n<td><code>RunAtLoad<\/code><\/td>\n<td>\u4ee3\u7406\u52a0\u8f7d\u65f6\u542f\u52a8\u96a7\u9053<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>OpenClaw.app \u8fde\u63a5\u5230\u4f60\u7684\u5ba2\u6237\u7aef\u673a\u5668\u4e0a\u7684 <code>ws:\/\/127.0.0.1:18789<\/code>\u3002SSH \u96a7\u9053\u5c06\u8be5\u8fde\u63a5\u8f6c\u53d1\u5230\u8fd0\u884c Gateway \u7f51\u5173 \u7f51\u5173\u7684\u8fdc\u7a0b\u673a\u5668\u7684\u7aef\u53e3 18789\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fdc\u7a0b Gateway \u7f51\u5173 \u7f51\u5173\u8bbe\u7f6e \u4f7f\u7528\u8fdc\u7a0b Gateway \u7f51\u5173 \u7f51\u5173\u8fd0\u884c OpenClaw.app Op [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-138","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=138"}],"version-history":[{"count":2,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/138\/revisions"}],"predecessor-version":[{"id":821,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/138\/revisions\/821"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}