<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sync on Sawyer Zheng's Blog</title><link>https://elated-raman-42e0c2.netlify.app/tags/sync/</link><description>Recent content in Sync on Sawyer Zheng's Blog</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Fri, 20 Jun 2025 16:04:15 +0800</lastBuildDate><atom:link href="https://elated-raman-42e0c2.netlify.app/tags/sync/index.xml" rel="self" type="application/rss+xml"/><item><title>Syncthing</title><link>https://elated-raman-42e0c2.netlify.app/post/notes/linux/syncthing/</link><pubDate>Mon, 21 Apr 2025 00:00:00 +0000</pubDate><guid>https://elated-raman-42e0c2.netlify.app/post/notes/linux/syncthing/</guid><description>&lt;div id="outline-container-headline-1" class="outline-2"&gt;
&lt;h2 id="headline-1"&gt;
如何在两台 ssh tunnel 连接的机器上使用 syncthing
&lt;/h2&gt;
&lt;div id="outline-text-headline-1" class="outline-text-2"&gt;
&lt;p&gt;
参考：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.syncthing.net/users/tunneling.html"&gt;SSH Tunneling — Syncthing documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
步骤：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;建立 ssh tunnel&lt;/p&gt;
&lt;div class="src src-sh"&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;autossh -M &lt;span class="m"&gt;0&lt;/span&gt; -N -L 127.0.0.1:22001:127.0.0.1:22000 -R 127.0.0.1:22001:127.0.0.1:22000 Remote-Server&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;-L local 22001 &amp;lt;– remote 22000&lt;/li&gt;
&lt;li&gt;-R remote 22000 –&amp;gt; local 22001&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;在本地 连接的 remote 上 &lt;code class="verbatim"&gt;选项 -&amp;gt; 高级&lt;/code&gt; 中，设定 remote 的连接地址： &lt;code&gt;tcp://127.0.0.1:22001&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;在远程机器上设置连接的 local 上， &lt;code class="verbatim"&gt;选项 -&amp;gt; 高级&lt;/code&gt; 中，设定 local 的连接地址： &lt;code&gt;tcp://127.0.0.1:22001&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item></channel></rss>