<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>网络 on LYon's Blog</title><link>https://yindongliang.com/docs/Linux/%E7%BD%91%E7%BB%9C/</link><description>Recent content in 网络 on LYon's Blog</description><generator>Hugo</generator><language>zh-cn</language><atom:link href="https://yindongliang.com/docs/Linux/%E7%BD%91%E7%BB%9C/index.xml" rel="self" type="application/rss+xml"/><item><title>iptables PREROUTING、FORWARD 与 POSTROUTING 详解</title><link>https://yindongliang.com/docs/Linux/%E7%BD%91%E7%BB%9C/iptables-PREROUTINGFORWARD-%E4%B8%8E-POSTROUTING-%E8%AF%A6%E8%A7%A3/</link><pubDate>Sun, 28 Jun 2026 00:00:00 +0000</pubDate><guid>https://yindongliang.com/docs/Linux/%E7%BD%91%E7%BB%9C/iptables-PREROUTINGFORWARD-%E4%B8%8E-POSTROUTING-%E8%AF%A6%E8%A7%A3/</guid><description>&lt;blockquote class='book-hint '>
&lt;p>说明：本文由 Codex 根据作者提供的主题、素材与公开资料辅助生成，属于 AI 生成/整理内容，非作者原创。请读者自行甄别并交叉验证。&lt;/p>&lt;/blockquote>&lt;h2 id="先说结论">先说结论&lt;a class="anchor" href="#%e5%85%88%e8%af%b4%e7%bb%93%e8%ae%ba">#&lt;/a>&lt;/h2>
&lt;p>&lt;code>PREROUTING&lt;/code>、&lt;code>FORWARD&lt;/code>、&lt;code>POSTROUTING&lt;/code> 是 Linux netfilter/iptables 处理数据包时常见的链。&lt;/p></description></item><item><title>SSH 常用命令指南</title><link>https://yindongliang.com/docs/Linux/%E7%BD%91%E7%BB%9C/SSH-%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E6%8C%87%E5%8D%97/</link><pubDate>Tue, 30 Dec 2025 00:00:00 +0000</pubDate><guid>https://yindongliang.com/docs/Linux/%E7%BD%91%E7%BB%9C/SSH-%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E6%8C%87%E5%8D%97/</guid><description>&lt;h2 id="1-生成-ssh-密钥对">1. 生成 SSH 密钥对&lt;a class="anchor" href="#1-%e7%94%9f%e6%88%90-ssh-%e5%af%86%e9%92%a5%e5%af%b9">#&lt;/a>&lt;/h2>
&lt;h3 id="生成-rsa-密钥对-传统">生成 RSA 密钥对 (传统)&lt;a class="anchor" href="#%e7%94%9f%e6%88%90-rsa-%e5%af%86%e9%92%a5%e5%af%b9-%e4%bc%a0%e7%bb%9f">#&lt;/a>&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>ssh-keygen -t rsa -b &lt;span style="color:#ff9f43">4096&lt;/span> -C &lt;span style="color:#5af78e">&amp;#34;your_email@example.com&amp;#34;&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>&lt;code>-t rsa&lt;/code>: 指定密钥类型为 RSA&lt;/li>
&lt;li>&lt;code>-b 4096&lt;/code>: 指定密钥位数为 4096 位&lt;/li>
&lt;li>&lt;code>-C &amp;quot;comment&amp;quot;&lt;/code>: 添加注释（通常是邮箱）&lt;/li>
&lt;/ul>
&lt;h3 id="生成-ed25519-密钥对-推荐更安全高效">生成 ED25519 密钥对 (推荐，更安全高效)&lt;a class="anchor" href="#%e7%94%9f%e6%88%90-ed25519-%e5%af%86%e9%92%a5%e5%af%b9-%e6%8e%a8%e8%8d%90%e6%9b%b4%e5%ae%89%e5%85%a8%e9%ab%98%e6%95%88">#&lt;/a>&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>ssh-keygen -t ed25519 -C &lt;span style="color:#5af78e">&amp;#34;your_email@example.com&amp;#34;&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="指定保存路径和密码">指定保存路径和密码&lt;a class="anchor" href="#%e6%8c%87%e5%ae%9a%e4%bf%9d%e5%ad%98%e8%b7%af%e5%be%84%e5%92%8c%e5%af%86%e7%a0%81">#&lt;/a>&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_custom -N &lt;span style="color:#5af78e">&amp;#34;passphrase&amp;#34;&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>&lt;code>-f&lt;/code>: 指定密钥文件保存路径&lt;/li>
&lt;li>&lt;code>-N&lt;/code>: 指定密码（空密码为&lt;code>&amp;quot;&amp;quot;&lt;/code>，不推荐）&lt;/li>
&lt;/ul>
&lt;h2 id="2-使用密钥连接远程服务器">2. 使用密钥连接远程服务器&lt;a class="anchor" href="#2-%e4%bd%bf%e7%94%a8%e5%af%86%e9%92%a5%e8%bf%9e%e6%8e%a5%e8%bf%9c%e7%a8%8b%e6%9c%8d%e5%8a%a1%e5%99%a8">#&lt;/a>&lt;/h2>
&lt;h3 id="指定密钥文件连接">指定密钥文件连接&lt;a class="anchor" href="#%e6%8c%87%e5%ae%9a%e5%af%86%e9%92%a5%e6%96%87%e4%bb%b6%e8%bf%9e%e6%8e%a5">#&lt;/a>&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>ssh -i /path/to/private_key username@hostname&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>&lt;code>-i&lt;/code>: 指定私钥文件路径&lt;/li>
&lt;/ul>
&lt;h3 id="指定端口和密钥">指定端口和密钥&lt;a class="anchor" href="#%e6%8c%87%e5%ae%9a%e7%ab%af%e5%8f%a3%e5%92%8c%e5%af%86%e9%92%a5">#&lt;/a>&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>ssh -i ~/.ssh/id_ed25519 -p &lt;span style="color:#ff9f43">2222&lt;/span> user@server.com&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>&lt;code>-p&lt;/code>: 指定连接端口&lt;/li>
&lt;/ul>
&lt;h2 id="3-ssh-配置文件">3. SSH 配置文件&lt;a class="anchor" href="#3-ssh-%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6">#&lt;/a>&lt;/h2>
&lt;h3 id="配置文件示例-sshconfig">配置文件示例 (~/.ssh/config)&lt;a class="anchor" href="#%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6%e7%a4%ba%e4%be%8b-sshconfig">#&lt;/a>&lt;/h3>
&lt;pre tabindex="0">&lt;code>Host myserver
 HostName server.com
 User username
 IdentityFile ~/.ssh/id_ed25519_custom
 Port 2222
 ServerAliveInterval 60
 
Host github
 HostName github.com
 User git
 IdentityFile ~/.ssh/id_ed25519_github&lt;/code>&lt;/pre>&lt;p>使用配置后连接:&lt;/p></description></item></channel></rss>