<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>SSH on 苍天的回响</title>
    <link>https://derek73.duckdns.org/tags/ssh/</link>
    <description>Recent content in SSH on 苍天的回响</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-cn</language>
    <lastBuildDate>Sat, 23 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://derek73.duckdns.org/tags/ssh/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>公网反向 SSH 隧道：用 Hermes Agent 操控内网 Ubuntu</title>
      <link>https://derek73.duckdns.org/posts/reverse-ssh-tunnel-hermes/</link>
      <pubDate>Sat, 23 May 2026 00:00:00 +0000</pubDate>
      
      <guid>https://derek73.duckdns.org/posts/reverse-ssh-tunnel-hermes/</guid>
      <description>背景 家里的 Ubuntu 没有公网 IP，但又想通过飞书上的 Hermes Agent 来操控它。直接暴露 SSH 端口到公网不安全，反向 SSH 隧道是最优雅的解法。
原理： Ubuntu 主动向外连接到 Oracle 服务器，建立一个反向隧道。Oracle 上的 Hermes 连接本地端口，实际通信通过隧道回到 Ubuntu。
前置条件 一台有公网 IP 的服务器（本文以 Oracle Cloud 为例，IP 150.230.5.211） 一台内网的 Ubuntu 机器 Ubuntu 上已安装 OpenSSH Server（sudo apt install openssh-server） 第一步：Oracle 上生成 SSH Key ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N &amp;#34;&amp;#34; -C &amp;#34;hermes-oracle&amp;#34; 查看公钥内容：
cat ~/.ssh/id_ed25519.pub 会得到类似这样的输出：
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICkgb19znwNDI1ys9mjdx1GYXiRoTEfZtiVA3ELhNbpx hermes-oracle 第二步：Ubuntu 上添加公钥 在 Ubuntu 上，将上一步得到的公钥追加到 authorized_keys：
echo &amp;#39;ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICkgb19znwNDI1ys9mjdx1GYXiRoTEfZtiVA3ELhNbpx hermes-oracle&amp;#39; &amp;gt;&amp;gt; ~/.</description>
    </item>
    
  </channel>
</rss>
