<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>老王日记</title><link>https://yjtv.top/</link><description>老王日记</description><item><title>OpenShell</title><link>https://yjtv.top/?id=43</link><description>&lt;figure class=&quot;article-cover&quot; style=&quot;margin:0 0 22px;text-align:center&quot;&gt;&lt;/figure&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;h1 style=&quot;font-size: 24px; line-height: 1.4; font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif;&quot;&gt;OpenShell&lt;/h1&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;给 AI agent 干活，最难的不是让它能干，而是让它只能干你允许它干的事。NVIDIA 的 OpenShell 就是冲着这个来的：一个给成群自主 agent 用的、安全又私有的运行时。你在策略里声明每个 agent 能碰什么，它负责在运行时强制执行，而不是事后看日志追悔。&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;这篇文章不复述 README，重点说它跟普通沙箱到底差在哪、适合谁、以及你第一次上手最容易踩的坑。&lt;/p&gt;&lt;h2 style=&quot;font-size: 21px; margin-top: 32px; font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; line-height: 1.4;&quot;&gt;一、为什么值得关注：它把“信任”从口头变成强制&lt;/h2&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;很多 agent 沙箱的逻辑是“先给权限，出事再收”。OpenShell 反过来：每个 agent 都跑在隔离沙箱里，内核层控制它能访问哪些文件、能做哪些系统调用，每一次联网都要先过策略检查才放行。这不是应用层的过滤，而是在更底层卡住，agent 绕不过去。&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;更关键的是第二层：策略改动不是改完就生效。改动前，它会用形式化验证先算一遍这个改动会新放开什么，比如能不能带着密钥去一个新主机、能不能调一个新 API 方法，算出高风险就先留给人审批。这一步很对安全团队的胃口，因为 agent 时代最大的风险往往不是 agent 本身，而是某次“顺手放宽一点”的策略改动。&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/blog/1792919909505_1792919898921_openshell-official-diagram.png&quot; alt=&quot;OpenShell 官方架构图&quot; style=&quot;max-width:100%;border-radius:12px;display:block;margin:16px auto&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;/p&gt;&lt;h2 style=&quot;font-size: 21px; margin-top: 32px; font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; line-height: 1.4;&quot;&gt;二、它怎么跑：网关、监管器、沙箱三件套&lt;/h2&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;架构上可以理解成三件套：网关是控制面，管沙箱、策略和访问；监管器盯着运行时的 agent；沙箱是 agent 真正干活的地方。默认沙箱镜像是一个最小的 Ubuntu，里面根本没装 agent，这一点第一次用的人很容易懵：装完以为就能跑 agent，其实还要按“跑第一个 agent”的指引去接一个真实 agent，比如用 OpenCode 配一个免费的 OpenRouter 模型。&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;安装本身是一条命令加一个建沙箱的命令，但前提要先满足：Linux、苹果芯片的 Mac，或者 Windows 加 WSL 2（还是实验性的），外加 Docker、Podman 或者主机虚拟化。没有这些，装完也跑不起来。&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/blog/1792919932806_1792919928039_media-generation-photo-engineer-approval-review-0-107c9777-9fd2-47.webp&quot; alt=&quot;工程师审核审批请求&quot; style=&quot;max-width:100%;border-radius:12px;display:block;margin:16px auto&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;/p&gt;&lt;h2 style=&quot;font-size: 21px; margin-top: 32px; font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; line-height: 1.4;&quot;&gt;三、适合谁，不适合谁&lt;/h2&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;适合三类人。第一类，已经在跑不止一个 agent、而且要给 agent 文件、装包、调 API、用密钥权限的团队和个人，越是 agent 多、权限杂，这个工具的价值越大。第二类，对数据和密钥外泄特别敏感的人：agent 在这里永远看不到真密钥，密钥只由 OpenShell 加到发往已批准 endpoint 的请求上。第三类，想把 agent 接进自己应用的开发者：它有 Python、TypeScript、Go、Rust 的 SDK，接网关用，但要注意 SDK 和网关尽量用同一个版本。&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;不适合两类人。一类是只想跟单个 agent 聊聊天、写写代码的人，这个工具的策略、网关、审批流程对他来说太重了。另一类是希望 agent 完全自主、不要人审批的人：OpenShell 的设计就是要在高风险改动前停下来等人看，追求“全自动不打扰”和追求“不出事”在这里是冲突的。&lt;/p&gt;&lt;h2 style=&quot;font-size: 21px; margin-top: 32px; font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; line-height: 1.4;&quot;&gt;四、上手体验和坑：先把这四条看完再装&lt;/h2&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;第一，别用 curl 管道直接装完就信。README 给的是一条 curl 安装脚本，先看一眼脚本里到底装了什么、装到哪，再跑，这是装任何这类工具都该有的习惯。&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;第二，策略要从小写起。先给 agent 最小的权限，跑起来、看它在哪些地方被拦、再按需放开，而不是一开始就给一个宽策略图省事。放宽策略的每一次改动都会先被验证器标出来，这正是这个工具想让你慢下来的地方。&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;第三，遥测默认是开着的。它说只收集匿名的运行类别和数量，不收集沙箱名、主机名、文件路径、提示词、密钥、模型名和用户内容，但如果你在意，还是要在网关上把 OPENSHELL_TELEMETRY_ENABLED 设为 false，或者 Helm 安装里把 server.telemetryEnabled 设为 false，也可以直接编译掉。&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;第四，版本还早。0.1.x 刚进入稳定发布节奏，改动和升级指引要跟上，别把生产 agent 群直接绑在一个还在快速演进的版本上，先在测试沙箱里跑通你的策略和审批流程。&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/blog/1792919988078_1792919959512_media-generation-photo-locked-key-cabinet-0-ad8681ad-69a3-46ea-ae0.webp&quot; alt=&quot;锁着的密钥柜&quot; style=&quot;max-width:100%;border-radius:12px;display:block;margin:16px auto&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;/p&gt;&lt;h2 style=&quot;font-size: 21px; margin-top: 32px; font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; line-height: 1.4;&quot;&gt;五、怎么试，第一次这样试最划算&lt;/h2&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;先在 Linux 或苹果芯片 Mac 上装好，建一个叫 demo 的沙箱，然后按官方指引跑第一个 agent，重点不是看 agent 能写出什么代码，而是看三件事：它第一次想访问没批准的东西时是不是真的被拦住；你放宽策略时，验证器是不是真的标出了新风险；密钥是不是真的没有出现在 agent 能看到的地方。&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;text-align:justify;&quot;&gt;这三件事都通过了，这个工具在你手里才算立住了。我的判断是：它值得关注，不是因为 NVIDIA 背书，而是因为它把 agent 安全里最难的一步——“给 agent 能力，但不给它失控的自由”——做成了可强制执行的运行时，而不是一份使用规范。&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8; text-align: justify;&quot;&gt;&lt;a href=&quot;https://github.com/NVIDIA/OpenShell&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;https://github.com/NVIDIA/OpenShell&lt;/a&gt;&lt;/p&gt;</description><pubDate>Sun, 25 Oct 2026 17:24:03 +0800</pubDate></item><item><title>GitHub 项目：security-audit-skill——让 AI 审计先学会别瞎报</title><link>https://yjtv.top/?id=42</link><description>&lt;figure class=&quot;article-cover&quot; style=&quot;margin:0 0 22px;text-align:center&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792855607602_rnd_1792855543922_0.webp&quot; alt=&quot;封面&quot; referrerpolicy=&quot;no-referrer&quot; style=&quot;max-width:100%;border-radius:10px;display:block;margin:0 auto&quot;/&gt;&lt;/figure&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;h1 style=&quot;font-size:24px;font-weight:700;color:#111111;line-height:1.4;margin:30px 0 14px;font-family:-apple-system, BlinkMacSystemFont, &amp;#39;Segoe UI&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Hiragino Sans GB&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;border-bottom:1px solid #eef1f4;padding-bottom:10px&quot;&gt;解读 GitHub 项目：security-audit-skill——让 AI 审计先学会别瞎报&lt;/h1&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;工作台今日候选里排第一的，是 Cloudflare 的 security-audit-skill。它不是又一个“让 AI 帮你看代码”的提示词合集，而是一个给 coding agent 用的审计技能：把一次安全审计拆成固定流程跑完，最后只认有证据的结论。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;这篇文章不复述 README，重点说三件事：它跟普通 AI 代码评审到底差在哪、适合谁上手、以及你第一次跑最容易踩的坑。&lt;/p&gt;&lt;h2 style=&quot;margin-top:32px;font-size:21px;font-weight:700;color:#111111;line-height:1.4;margin:28px 0 12px;font-family:-apple-system, BlinkMacSystemFont, &amp;#39;Segoe UI&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Hiragino Sans GB&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;border-bottom:1px solid #eef1f4;padding-bottom:10px&quot;&gt;一、为什么值得关注：它治的是 AI 审计最常见的毛病&lt;/h2&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;普通 agent 做代码评审，常见毛病不是找得少，而是报得多、证据少。一段看着可疑的代码，它能讲出一套很像那么回事的攻击链，但你顺着源码一查，发现前提根本不成立。修这种“假漏洞”比不修更浪费时间，还会把真正的风险淹没。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;这个技能的核心设计，就是把“找”和“验”分给不同的人。找漏洞的 agent 不能自己给自己盖章，验证的 agent 必须想办法证伪它。证伪不了、证据链完整的，才进 confirmed；证据不完整、还差一个关键事实的，不给严重程度，只记成 needs_validation；被证伪的，记成 rejected，并且留着记录。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;这个区分比结论本身更重要。对做审计的人来说，最怕的不是漏报一个低危问题，而是把“还没搞清楚”当成“已经确认”，然后按严重程度排期去修。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792855979727_1792855970623_media-generation-audit-robot-code-0-30da0958-8855-4906-8f97-a0cd29.webp&quot; alt=&quot;段落配图：机器人审计员检查代码&quot; referrerpolicy=&quot;no-referrer&quot; style=&quot;max-width:100%;border-radius:12px;display:block;margin:16px auto;height:auto&quot;/&gt;&lt;/p&gt;&lt;h2 style=&quot;margin-top:32px;font-size:21px;font-weight:700;color:#111111;line-height:1.4;margin:28px 0 12px;font-family:-apple-system, BlinkMacSystemFont, &amp;#39;Segoe UI&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Hiragino Sans GB&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;border-bottom:1px solid #eef1f4;padding-bottom:10px&quot;&gt;二、它怎么跑：六个阶段，其实就三句话&lt;/h2&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;流程说起来是六个阶段，理解起来可以压成三句话。第一句，先画地图：侦察阶段把架构、可信边界、输入面和已有的覆盖情况写成 architecture.md 和 coverage-ledger.json，后面所有工作都对照这张地图查缺补漏，而不是想到哪查到哪。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;第二句，分头找、分头验：按覆盖清单派不同的猎手去查，覆盖评审员专门找没覆盖到的地方；每个候选漏洞都交给一个全新的验证者去证伪。第三句，只从已验证的记录生成报告，报告不是 agent 现场发挥写出来的，而是从 findings.json 和覆盖清单里推导出来的。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;多次跑同一个仓库，结果是累加的：它会用以前的清单和结论去盯改动过的地方、重新验证变了的源码，而不是把旧结论当成已覆盖。这个设计很对审计的胃口，因为代码审计本来就不是一次性工作。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792856044644_1792856031226_media-generation-hunter-verifier-pipeline-0-4e038c5f-34c6-4be8-be5.webp&quot; alt=&quot;段落配图：猎手与验证者分处隔离房间&quot; referrerpolicy=&quot;no-referrer&quot; style=&quot;max-width:100%;border-radius:12px;display:block;margin:16px auto;height:auto&quot;/&gt;&lt;/p&gt;&lt;h2 style=&quot;margin-top:32px;font-size:21px;font-weight:700;color:#111111;line-height:1.4;margin:28px 0 12px;font-family:-apple-system, BlinkMacSystemFont, &amp;#39;Segoe UI&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Hiragino Sans GB&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;border-bottom:1px solid #eef1f4;padding-bottom:10px&quot;&gt;三、适合谁，不适合谁&lt;/h2&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;适合三类人。第一类，自己维护一个有一定规模的代码库，想定期跑一次结构化审计，但请不起外部审计团队的人。第二类，团队里已经在用 Claude Code、Codex 这类支持并行子 agent 的工具，想把“AI 评审”从聊天变成可复查流程的人。第三类，想学习安全审计方法论的人：它自带的攻击面清单覆盖 Web、客户端、供应链、云和部署、协议、资源耗尽、数据隔离这些方向，照着清单走一遍，比零散看漏洞文章系统得多。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;不适合两类人。一类是只想快速扫一遍、马上要一份漏洞列表交差的人，这个流程本来就慢，而且故意不给你“看起来很严重但没证据”的结论。另一类是完全没有安全基础、希望 agent 直接告诉你“修这里就行”的人：它给的是证据和待验证项，最终判断还是要人做。&lt;/p&gt;&lt;h2 style=&quot;margin-top:32px;font-size:21px;font-weight:700;color:#111111;line-height:1.4;margin:28px 0 12px;font-family:-apple-system, BlinkMacSystemFont, &amp;#39;Segoe UI&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Hiragino Sans GB&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;border-bottom:1px solid #eef1f4;padding-bottom:10px&quot;&gt;四、上手体验和坑：先把这四条看完再跑&lt;/h2&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;安装本身不难，用 Skills CLI 装好技能，在代码库里对 agent 说一句“security audit this codebase”就能触发。真正的坑在运行条件上。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;第一，沙箱是硬要求。README 明确要求一个操作系统级沙箱：跑目标代码、测试、浏览器、模糊测试这些动作时必须断外网、环境白名单、资源受限、只写指定的临时目录。没有这个沙箱，流程不会替你冒险执行目标代码，相关线索会一直停留在 needs_validation。你以为是审计没跑完，其实是它在等一个安全的执行环境。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;第二，成本和时间要按“多次跑”来算。官方自己的测试里，单次跑找到的漏洞大约只有多次跑总和的一半左右。这意味着只跑一次就下结论，很可能漏掉一半；但多次跑也意味着 token 和时间成倍涨。第一次试，建议先拿一个自己熟悉的小仓库跑，别直接上生产大仓。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;第三，别把输出目录搞错。完整审计模式下，默认输出在 ~/security-audit-skill/&amp;lt;仓库名&amp;gt;/run-&amp;lt;编号&amp;gt;，只有当你明确选了一个版本控制忽略的目录时，它才会在目标仓库里写东西。跑之前先确认输出落在哪，别事后才发现审计产物混进了提交里。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;第四，验证脚本别跳过。它自带两个零依赖的 Node 验证器，分别校验覆盖清单和 findings.json，流程里会在关键阶段跑它们。如果你手动改了结论文件，跑一下验证器比肉眼检查靠谱。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792856083842_1792856078823_media-generation-sandbox-cost-warning-0-f8889488-e86a-47c3-8703-53.webp&quot; alt=&quot;段落配图：沙箱与成本警示&quot; referrerpolicy=&quot;no-referrer&quot; style=&quot;max-width:100%;border-radius:12px;display:block;margin:16px auto;height:auto&quot;/&gt;&lt;/p&gt;&lt;h2 style=&quot;margin-top:32px;font-size:21px;font-weight:700;color:#111111;line-height:1.4;margin:28px 0 12px;font-family:-apple-system, BlinkMacSystemFont, &amp;#39;Segoe UI&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Hiragino Sans GB&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;border-bottom:1px solid #eef1f4;padding-bottom:10px&quot;&gt;五、怎么试，第一次这样试最划算&lt;/h2&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;先装技能，再找一个你自己写过、规模不大的项目，对 agent 说做一次安全审计。跑完先别看报告正文，先看 findings.json 里三类结论各有多少：如果 confirmed 很少、needs_validation 一大堆，问题大概率出在沙箱或执行条件上，而不是代码真的很干净。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;然后挑一个 confirmed 结论，顺着它的源码追踪自己复现一遍；再挑一个 needs_validation，看看它到底卡在哪一个没确认的事实上。这个过程走完，你就知道这个技能在你手里是“能用的审计流程”，还是“又一个报得多、证据少的评审工具”。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;我的判断是：它值得关注，不是因为 Cloudflare 背书，而是因为它把审计里最难的一步——“别轻信自己的发现”——做成了流程。AI 审计以后拼的不是谁找得多，而是谁的结论经得起复查，这个技能就是往那个方向走的。&lt;/p&gt;&lt;p style=&quot;font-size:15px;line-height:1.8;color:#3f3f3f;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;项目地址：&lt;a href=&quot;https://github.com/cloudflare/security-audit-skill&quot; style=&quot;color:#0969da;text-decoration:none;&quot;&gt;https://github.com/cloudflare/security-audit-skill&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;note&quot; style=&quot;color:#666;font-size:15px;line-height:1.8;margin:0 0 16px;word-break:break-word;font-family:&amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Segoe UI&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Arial, sans-serif;text-align:justify;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;style id=&quot;preview-font-override&quot;&gt;#preview, #preview * { font-family: 'PingFang SC','Microsoft YaHei','Segoe UI','Helvetica Neue',Arial,sans-serif !important; }
#preview p, #preview li, #preview td, #preview th, #preview figcaption, #preview dd, #preview dt, #preview .series { font-size: 15px !important; line-height: 1.8 !important; }
#preview h1 { font-size: 24px !important; line-height: 1.4 !important; }
#preview h2 { font-size: 21px !important; line-height: 1.4 !important; }
#preview h3 { font-size: 18px !important; line-height: 1.4 !important; }
#preview h4 { font-size: 16px !important; line-height: 1.4 !important; }
#preview h5 { font-size: 15px !important; line-height: 1.4 !important; }
#preview h6 { font-size: 14px !important; line-height: 1.4 !important; }
#preview blockquote { font-size: 14px !important; }
#preview pre, #preview code { font-family: Consolas,'JetBrains Mono','Fira Code',Menlo,Monaco,'Courier New',monospace !important; }&lt;/style&gt;</description><pubDate>Sat, 24 Oct 2026 23:40:59 +0800</pubDate></item><item><title>免费流量被爬虫刷爆：用 Nginx 444 精准拦截（附安全配置清单）</title><link>https://yjtv.top/?id=41</link><description>&lt;div class=&quot;wrap&quot; style=&quot; margin: 0px auto; padding: 0px 0px 40px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;
  &lt;div class=&quot;cover&quot; style=&quot;background: linear-gradient(135deg, rgb(15, 81, 50) 0%, rgb(25, 135, 84) 100%); color: rgb(255, 255, 255); padding: 34px 28px 28px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;
    &lt;p class=&quot;series&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;云服务器运维实战系列 · 第 7 篇（共 7 篇）&lt;/p&gt;
  &lt;/div&gt;
&lt;section class=&quot;post&quot; style=&quot;background: rgb(255, 255, 255); margin: 26px 16px 0px; border-radius: 12px; padding: 8px 26px 26px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;
&lt;article id=&quot;post7&quot; style=&quot;font-size: 16px; line-height: 1.8; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif;&quot;&gt;
&lt;h1 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 26px; line-height: 1.4;&quot;&gt;免费流量被爬虫刷爆：用 Nginx 444 精准拦截（附安全配置清单）&lt;/h1&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;免费套餐的服务器，出站流量有额度，超了可能收费。我在面板上看到上行一直有流量、速度还不低，站点没几个人访问，数据却一直在往外发。查了 Nginx 日志，发现是大量 AI 训练爬虫和扫描器在反复抓页面、扫路径。&lt;/p&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;这篇讲怎么确认是谁在刷、怎么用 Nginx 的 444 状态码在连接层直接掐掉，以及顺手整理的一份安全配置。&lt;/p&gt;
&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第一步：确认流量是谁产生的&lt;/h2&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;先看访问日志里都有哪些 User-Agent、哪些 IP 最活跃：&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792676890223_imp_1792676859937_a7-find-bots.png&quot; alt=&quot;从访问日志统计活跃 IP 和 User-Agent。&quot; referrerpolicy=&quot;no-referrer&quot;&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;从访问日志统计活跃 IP 和 User-Agent。&lt;/figcaption&gt;&lt;/figure&gt;
&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;letter-spacing:.5px;text-transform:uppercase;user-select:none;&quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;font-size:14px;line-height:1.6;color:#24292e;word-break:normal;tab-size:4;&quot;&gt;&lt;code style=&quot;background:transparent;padding:0;margin:0;font-family:inherit;font-size:inherit;line-height:inherit;color:inherit;white-space:pre;word-break:normal;&quot;&gt;# 统计访问最多的 IP
sudo awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head

# 统计出现最多的 User-Agent
sudo awk -F'&quot;' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head -20
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;我看到大量请求来自这些公开的 AI/采集爬虫和扫描器（UA 里直接带名字）：&lt;/p&gt;
&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Text&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;letter-spacing:.5px;text-transform:uppercase;user-select:none;&quot;&gt;Text&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;font-size:14px;line-height:1.6;color:#24292e;word-break:normal;tab-size:4;&quot;&gt;&lt;code style=&quot;background:transparent;padding:0;margin:0;font-family:inherit;font-size:inherit;line-height:inherit;color:inherit;white-space:pre;word-break:normal;&quot;&gt;SemrushBot
meta-externalagent / meta-externalfetcher
ClaudeBot / anthropic
Bytespider
python-requests / Go-http-client / curl（扫描器常用）
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;它们有的反复抓整站，有的专扫 &lt;code&gt;.env&lt;/code&gt;、&lt;code&gt;wp-login&lt;/code&gt;、&lt;code&gt;phpmyadmin&lt;/code&gt; 这类敏感路径。页面虽然小，但架不住请求量大，累计出站流量很可观。&lt;/p&gt;
&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第二步：为什么用 444，而不是 403&lt;/h2&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Nginx 有个非标准状态码 &lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;444&lt;/strong&gt;（&lt;code&gt;return 444&lt;/code&gt;）：它不返回任何 HTTP 响应，直接在 Nginx 这一端关闭连接。&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792676892547_imp_1792676886443_05-nginx-crawler-gate.png&quot; alt=&quot;命中规则后直接断开连接，不返回响应体。&quot; referrerpolicy=&quot;no-referrer&quot;&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;命中规则后直接断开连接，不返回响应体。&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;对比：&lt;/p&gt;
&lt;ul style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;
&lt;li style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;code&gt;403 Forbidden&lt;/code&gt;：仍然要走完响应，返回一个错误页，客户端还会继续换路径试；&lt;/li&gt;
&lt;li style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;code&gt;444&lt;/code&gt;：连接直接断，不发响应体，&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;不产生出站流量&lt;/strong&gt;，对刷量的爬虫最省事。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第三步：按 User-Agent 拦截&lt;/h2&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;在 &lt;code&gt;http&lt;/code&gt; 块（通常放 &lt;code&gt;/etc/nginx/conf.d/&lt;/code&gt; 下的独立文件，或 nginx.conf 的 http 段）用 map 标记恶意 UA：&lt;/p&gt;
&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;nginx&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;letter-spacing:.5px;text-transform:uppercase;user-select:none;&quot;&gt;nginx&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;font-size:14px;line-height:1.6;color:#24292e;word-break:normal;tab-size:4;&quot;&gt;&lt;code style=&quot;background:transparent;padding:0;margin:0;font-family:inherit;font-size:inherit;line-height:inherit;color:inherit;white-space:pre;word-break:normal;&quot;&gt;# 放在 http {} 内
map $http_user_agent $bad_bot {
    default 0;
    ~*SemrushBot             1;
    ~*meta-externalagent     1;
    ~*meta-externalfetcher   1;
    ~*ClaudeBot              1;
    ~*anthropic-ai           1;
    ~*Bytespider             1;
    ~*AhrefsBot              1;
    ~*MJ12bot                1;
    ~*DotBot                 1;
    ~*(python-requests|Go-http-client|libwww-perl) 1;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;然后在需要保护的 &lt;code&gt;server&lt;/code&gt; 块里拦截：&lt;/p&gt;
&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;nginx&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;letter-spacing:.5px;text-transform:uppercase;user-select:none;&quot;&gt;nginx&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;font-size:14px;line-height:1.6;color:#24292e;word-break:normal;tab-size:4;&quot;&gt;&lt;code style=&quot;background:transparent;padding:0;margin:0;font-family:inherit;font-size:inherit;line-height:inherit;color:inherit;white-space:pre;word-break:normal;&quot;&gt;server {
    listen 443 ssl;
    server_name 你的域名;

    # 命中恶意 UA 直接断连
    if ($bad_bot) {
        return 444;
    }

    # 其余正常配置 ...
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;注意：Nginx 配置里 &lt;code&gt;if&lt;/code&gt; 在 location 内容易踩坑，但在 server 层做简单的 &lt;code&gt;return&lt;/code&gt; 是安全的官方用法。改完先测试再重载：&lt;/p&gt;
&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;letter-spacing:.5px;text-transform:uppercase;user-select:none;&quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;font-size:14px;line-height:1.6;color:#24292e;word-break:normal;tab-size:4;&quot;&gt;&lt;code style=&quot;background:transparent;padding:0;margin:0;font-family:inherit;font-size:inherit;line-height:inherit;color:inherit;white-space:pre;word-break:normal;&quot;&gt;sudo nginx -t &amp;amp;&amp;amp; sudo systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;UA 名单按自己日志里实际出现的补，&lt;code&gt;~*&lt;/code&gt; 表示不区分大小写。如果你&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;希望&lt;/strong&gt;自己的内容被某些 AI 检索，就别把对应 Bot 加进去。&lt;/p&gt;
&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第四步：拦截敏感路径扫描&lt;/h2&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;扫描器最爱探测的路径，也直接 444：&lt;/p&gt;
&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;nginx&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;letter-spacing:.5px;text-transform:uppercase;user-select:none;&quot;&gt;nginx&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;font-size:14px;line-height:1.6;color:#24292e;word-break:normal;tab-size:4;&quot;&gt;&lt;code style=&quot;background:transparent;padding:0;margin:0;font-family:inherit;font-size:inherit;line-height:inherit;color:inherit;white-space:pre;word-break:normal;&quot;&gt;server {
    # ...

    # 常见敏感文件 / 后台扫描
    location ~* /\.(env|git|htaccess|htpasswd) { return 444; }
    location ~* /(wp-login|wp-admin|xmlrpc\.php) { return 444; }
    location ~* /(phpmyadmin|pma|adminer) { return 444; }
    location ~* /(vendor|tmp|backup|config)\. { return 444; }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;这里有个我实际踩过的点：&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;location 的匹配顺序&lt;/strong&gt;。Nginx 正则 location 按书写顺序匹配、第一个命中即停；如果请求在 server 层已被 rewrite 改写成别的 URI，再用 location 正则去拦原始路径可能拦不到。所以拦截规则要针对最终生效的 URI，或干脆在 server 层用 &lt;code&gt;if ($bad_bot)&lt;/code&gt; 这种不受 rewrite 影响的方式处理 UA。&lt;/p&gt;
&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第五步：限速，兜底防刷&lt;/h2&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;对没被直接拉黑、但请求过密的，做连接和请求限速：&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792676901792_imp_1792676892747_a7-limit.png&quot; alt=&quot;限速处理未直接拦截的高频请求。&quot; referrerpolicy=&quot;no-referrer&quot;&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;限速处理未直接拦截的高频请求。&lt;/figcaption&gt;&lt;/figure&gt;
&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;nginx&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;letter-spacing:.5px;text-transform:uppercase;user-select:none;&quot;&gt;nginx&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;font-size:14px;line-height:1.6;color:#24292e;word-break:normal;tab-size:4;&quot;&gt;&lt;code style=&quot;background:transparent;padding:0;margin:0;font-family:inherit;font-size:inherit;line-height:inherit;color:inherit;white-space:pre;word-break:normal;&quot;&gt;# http 块定义限速区
limit_req_zone $binary_remote_addr zone=general:10m rate=10r/s;
limit_conn_zone $binary_remote_addr zone=addrlimit:10m;

server {
    limit_req zone=general burst=20 nodelay;
    limit_conn addrlimit 20;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;code&gt;rate=10r/s&lt;/code&gt; 是平均每秒 10 个请求，&lt;code&gt;burst=20&lt;/code&gt; 允许短时 20 个排队，正常访客无感，脚本狂刷会被挡。&lt;/p&gt;
&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;验证效果&lt;/h2&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;重载后，用被封的 UA 本机测试：&lt;/p&gt;
&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;letter-spacing:.5px;text-transform:uppercase;user-select:none;&quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;JetBrains Mono&quot;, &quot;Fira Code&quot;, Menlo, Monaco, &quot;Courier New&quot;, monospace;font-size:14px;line-height:1.6;color:#24292e;word-break:normal;tab-size:4;&quot;&gt;&lt;code style=&quot;background:transparent;padding:0;margin:0;font-family:inherit;font-size:inherit;line-height:inherit;color:inherit;white-space:pre;word-break:normal;&quot;&gt;# 用恶意 UA 请求，应直接被断开（无响应）
curl -A &quot;SemrushBot&quot; -I https://你的域名/

# 正常 UA 请求，应返回 200/301
curl -A &quot;Mozilla/5.0&quot; -I https://你的域名/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;再观察面板流量和 access.log，被拦的请求不再产生响应流量，上行明显回落。也可以统计日志里 444（若记录了的话）的数量确认命中。&lt;/p&gt;
&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;顺手整理的安全清单&lt;/h2&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;结合这次迁移，给服务器定的几条基础防护：&lt;/p&gt;
&lt;ol style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;
&lt;li style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;只开放必要端口，面板、数据库不直接暴露公网；数据库只监听 127.0.0.1；&lt;/li&gt;
&lt;li style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;phpMyAdmin 等管理工具不开公网，需要时通过 SSH 隧道或反代 + 访问限制进入；&lt;/li&gt;
&lt;li style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;SSH 换非默认端口、禁用密码登录改用密钥、限制 root 直接登录；&lt;/li&gt;
&lt;li style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;面板用强密码 + 安全入口，及时更新面板和插件；&lt;/li&gt;
&lt;li style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Nginx 层拦恶意 UA、敏感路径，并做限速；&lt;/li&gt;
&lt;li style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;网站目录权限最小化，删掉不用的站点和默认页；&lt;/li&gt;
&lt;li style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;定期自动导出数据库、异地备份，备份文件不放在 web 可访问目录；&lt;/li&gt;
&lt;li style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;定期看一眼流量和日志，异常刷量早发现。&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;小结&lt;/h2&gt;
&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;防爬虫刷量的关键是先看日志、确认是谁，再在 Nginx 层处理：恶意 UA 和敏感路径用 &lt;code&gt;return 444&lt;/code&gt; 直接断连、不产生流量，其余靠限速兜底。免费额度有限，与其等流量超了，不如在入口就把无意义的抓取掐掉。&lt;/p&gt;
  &lt;/article&gt;
&lt;/section&gt;
&lt;div class=&quot;footer&quot; style=&quot; color: rgb(154, 160, 168); font-size: 16px; margin: 28px 16px 0px; line-height: 1.8; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif;&quot;&gt;本系列基于真实运维操作整理，文中 IP / 域名 / 账号 / 密码等信息均已脱敏。&lt;/div&gt;
&lt;/div&gt;</description><pubDate>Thu, 22 Oct 2026 21:50:51 +0800</pubDate></item><item><title>甲骨云服务器运维实战系列——家里连不上云服务器：TCP 能连、SSH 一握手就断，是端口被拦了</title><link>https://yjtv.top/?id=26</link><description>&lt;div class=&quot;wrap&quot; style=&quot; margin: 0px auto; padding: 0px 0px 40px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;div class=&quot;cover&quot; style=&quot;background: linear-gradient(135deg, rgb(15, 81, 50) 0%, rgb(25, 135, 84) 100%); color: rgb(255, 255, 255); padding: 34px 28px 28px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;p class=&quot;series&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;云服务器运维实战系列 · 第 6 篇（共 7 篇）&lt;/p&gt;&lt;/div&gt;&lt;section class=&quot;post&quot; style=&quot;background: rgb(255, 255, 255); margin: 26px 16px 0px; border-radius: 12px; padding: 8px 26px 26px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;article id=&quot;post6&quot; style=&quot;font-size: 16px; line-height: 1.8; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif;&quot;&gt;&lt;h1 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 26px; line-height: 1.4;&quot;&gt;家里连不上云服务器：TCP 能连、SSH 一握手就断，是端口被拦了&lt;/h1&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;从家里连云服务器，会遇到一种很隐蔽的情况：网络看着是通的，端口也像开着，但 SSH 刚握手就被掐断，报 &lt;code&gt;Connection closed&lt;/code&gt;、&lt;code&gt;Connection reset&lt;/code&gt;，或者干脆超时。换手机热点却能正常连。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;这篇记录怎么一步步确认问题出在端口、而不是服务器，以及怎么绕过去。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;先分清是哪种&amp;quot;连不上&amp;quot;&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;不同报错指向不同环节，先对号入座：&lt;/p&gt;&lt;table style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;thead style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;tr style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;th style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;现象&lt;/th&gt;&lt;th style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;大致含义&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;tr style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;td style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;code&gt;Connection refused&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;网络通，但目标端口没有服务监听（服务没起 / 端口错）&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;td style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;code&gt;Connection timed out&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;包发出去没回应，可能被防火墙静默丢弃&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;td style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;code&gt;Connection reset / closed&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;连上了，但中途被设备主动掐断&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;td style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;能 TCP 连通，握手立刻断&lt;/td&gt;&lt;td style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;典型的中间设备针对端口的干预&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;我遇到的是最后一种：SSH 客户端显示连接建立，紧接着 &lt;code&gt;Connection closed by &amp;lt;IP&amp;gt; port 22&lt;/code&gt;，服务端没留下拒绝记录。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第一步：在服务器上确认服务和防火墙&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;先排除服务器自身问题。在能登录的通道（其他网络、面板终端、串口控制台）上检查：&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792673535548_imp_1792673503392_a6-server-check.png&quot; alt=&quot;先确认 sshd 监听、防火墙规则和本机连接。&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;先确认 sshd 监听、防火墙规则和本机连接。&lt;/figcaption&gt;&lt;/figure&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;#&amp;nbsp;sshd&amp;nbsp;是否在跑、监听哪个端口
sudo&amp;nbsp;ss&amp;nbsp;-tlnp&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;-E&amp;nbsp;&amp;#39;:22|:8443&amp;#39;

#&amp;nbsp;本机连自己，验证服务正常
ssh&amp;nbsp;-p&amp;nbsp;22&amp;nbsp;用户名@127.0.0.1&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;再看本机防火墙是否放行（甲骨文镜像默认 iptables 有兜底 REJECT，需要显式放行）：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;sudo&amp;nbsp;iptables&amp;nbsp;-L&amp;nbsp;INPUT&amp;nbsp;-n&amp;nbsp;--line-numbers&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;-E&amp;nbsp;&amp;#39;22|REJECT|DROP&amp;#39;
sudo&amp;nbsp;ufw&amp;nbsp;status&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;如果本机连 127.0.0.1 正常、防火墙也放行了 22，但外网就是连不上，问题基本不在服务器。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第二步：看服务端有没有你的连接记录&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;这是判断&amp;quot;封锁发生在哪一段&amp;quot;的关键。在家里反复连接的同时，看服务器日志：&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792673538127_imp_1792673527613_a6-log-path.png&quot; alt=&quot;服务端无连接记录，问题可能发生在到达 sshd 之前。&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;服务端无连接记录，问题可能发生在到达 sshd 之前。&lt;/figcaption&gt;&lt;/figure&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;sudo&amp;nbsp;tail&amp;nbsp;-30&amp;nbsp;/var/log/auth.log&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;-E&amp;nbsp;&amp;quot;Connection&amp;nbsp;from|Failed|Accepted&amp;quot;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;ul style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;如果日志里&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;完全没有&lt;/strong&gt;你家里 IP 的连接记录，但客户端却显示&amp;quot;TCP 已连接&amp;quot;，说明连接在到达 sshd 之前就被中间设备处理掉了；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;如果有记录并显示 &lt;code&gt;Accepted&lt;/code&gt;，那是连上后又被断开，方向另查。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;我这边：家里连接时服务端毫无记录，手机热点连接立刻有 &lt;code&gt;Connection from&lt;/code&gt; 和 &lt;code&gt;Accepted&lt;/code&gt;。说明问题出在家宽到服务器之间的链路，针对 22 端口。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第三步：用 TCP 探测验证端口可达性&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;区分&amp;quot;端口被拦&amp;quot;还是&amp;quot;整条线路不通&amp;quot;：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;#&amp;nbsp;在家用机器上探测&amp;nbsp;22&amp;nbsp;端口
nc&amp;nbsp;-vz&amp;nbsp;&amp;lt;服务器IP&amp;gt;&amp;nbsp;22

#&amp;nbsp;对比探测一个确定开放的端口，如&amp;nbsp;443
nc&amp;nbsp;-vz&amp;nbsp;&amp;lt;服务器IP&amp;gt;&amp;nbsp;443&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;结果是：443 能通，22 要么超时、要么连上立刻被 reset。同一台服务器、同一个出口 IP，只有特定端口异常，这就是端口级封锁的特征——不是 IP 被封，而是 22 这个端口在家宽这条路上被设备干预了（家宽网络常见对 22 等端口做限制或干扰）。&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792673542478_imp_1792673535597_a6-port-compare.png&quot; alt=&quot;对比同一线路的 22 与 443，判断是否端口级干预。&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;对比同一线路的 22 与 443，判断是否端口级干预。&lt;/figcaption&gt;&lt;/figure&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第四步：确认是不是 fail2ban / 连接数&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;也要排除服务器端把你&amp;quot;ban&amp;quot;了的可能：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;sudo&amp;nbsp;fail2ban-client&amp;nbsp;status&amp;nbsp;sshd&amp;nbsp;2&amp;gt;/dev/null&amp;nbsp;||&amp;nbsp;echo&amp;nbsp;&amp;quot;无&amp;nbsp;fail2ban&amp;quot;
sudo&amp;nbsp;ss&amp;nbsp;-tnp&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;&amp;quot;:22&amp;quot;&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;-v&amp;nbsp;LISTEN&amp;nbsp;|&amp;nbsp;wc&amp;nbsp;-l
grep&amp;nbsp;-E&amp;nbsp;&amp;quot;MaxStartups|Port&amp;nbsp;&amp;quot;&amp;nbsp;/etc/ssh/sshd_config&amp;nbsp;/etc/ssh/sshd_config.d/*.conf&amp;nbsp;2&amp;gt;/dev/null&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;如果 fail2ban 的封禁列表里有你家里的出口 IP，解封即可（&lt;code&gt;sudo fail2ban-client set sshd unbanip &amp;lt;IP&amp;gt;&lt;/code&gt;）。我这边没有 fail2ban 记录，连接数也正常，排除。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;怎么绕过&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;确认是家宽针对端口的限制后，有三条路，按方便程度排：&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;1. 给 SSH 换一个高位端口。&lt;/strong&gt; 家宽通常只针对常见端口，换个不常见的端口往往就通了：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;#&amp;nbsp;新增监听端口（保留22，确认新端口可用后再决定是否关22）
echo&amp;nbsp;&amp;quot;Port&amp;nbsp;8443&amp;quot;&amp;nbsp;|&amp;nbsp;sudo&amp;nbsp;tee&amp;nbsp;-a&amp;nbsp;/etc/ssh/sshd_config
sudo&amp;nbsp;systemctl&amp;nbsp;restart&amp;nbsp;ssh

#&amp;nbsp;放行新端口：iptables&amp;nbsp;和&amp;nbsp;ufw&amp;nbsp;都要
sudo&amp;nbsp;iptables&amp;nbsp;-I&amp;nbsp;INPUT&amp;nbsp;-p&amp;nbsp;tcp&amp;nbsp;--dport&amp;nbsp;8443&amp;nbsp;-j&amp;nbsp;ACCEPT
sudo&amp;nbsp;ufw&amp;nbsp;allow&amp;nbsp;8443/tcp&amp;nbsp;2&amp;gt;/dev/null&amp;nbsp;||&amp;nbsp;true&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;连接：&lt;code&gt;ssh -p 8443 用户名@&amp;lt;IP&amp;gt;&lt;/code&gt;。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;2. 走 443，用 Nginx 反代/SSL 隧道。&lt;/strong&gt; 443 几乎不会被家宽拦（拦了所有 HTTPS 网站都受影响）。把 SSH 藏到 443，或用 Nginx 按 SNI/流量特征分流，是最稳的长期方案。我同时也用 443 反代面板，访问明显稳定。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;3. 临时用手机热点 / 其他网络。&lt;/strong&gt; 排查和应急很方便，也能用来反证是不是家宽的问题。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;排查顺序小结&lt;/h2&gt;&lt;ol style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;服务器上确认 sshd 正常、防火墙放行、本机可连；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;连接时看 &lt;code&gt;auth.log&lt;/code&gt; 有没有你的记录——没有，说明没到服务器；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;nc&lt;/code&gt; 对比探测 22 和 443，只有 22 异常即端口级封锁；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;排除 fail2ban、连接数、MaxStartups；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;换高位端口，或走 443 反代，应急用热点。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;判断要点就一条：&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;同一条线路、同一台机器，别的端口通、只有某个端口不通，问题就不在你的服务器，而在中间网络对该端口的处理。&lt;/strong&gt;&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;div class=&quot;footer&quot; style=&quot; color: rgb(154, 160, 168); font-size: 16px; margin: 28px 16px 0px; line-height: 1.8; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif;&quot;&gt;本系列基于真实运维操作整理，文中 IP / 域名 / 账号 / 密码等信息均已脱敏。&lt;/div&gt;&lt;/div&gt;</description><pubDate>Thu, 22 Oct 2026 20:53:56 +0800</pubDate></item><item><title>ARM 服务器编译 PHP 报 file in wrong format：是依赖库的架构错了</title><link>https://yjtv.top/?id=25</link><description>&lt;div class=&quot;wrap&quot; style=&quot;margin: 0px auto; padding: 0px 0px 40px; font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;div class=&quot;cover&quot; style=&quot;background: linear-gradient(135deg, rgb(15, 81, 50) 0%, rgb(25, 135, 84) 100%); color: rgb(255, 255, 255); padding: 34px 28px 28px; font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;p class=&quot;series&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;云服务器运维实战系列 · 第 5 篇（共 7 篇）&lt;/p&gt;&lt;/div&gt;&lt;section class=&quot;post&quot; style=&quot;background: rgb(255, 255, 255); margin: 26px 16px 0px; border-radius: 12px; padding: 8px 26px 26px; font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;article id=&quot;post5&quot; style=&quot;font-size: 15px; line-height: 1.8; font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif;&quot;&gt;&lt;h1 style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 24px; line-height: 1.4;&quot;&gt;ARM 服务器编译 PHP 报 file in wrong format：是依赖库的架构错了&lt;/h1&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;在 ARM 服务器上用宝塔编译 PHP 8.2，前面编译都正常，到最后链接阶段突然失败：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;Text&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Text&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;/bin/ld:&amp;nbsp;/usr/local/curl_2/lib/libcurl.so:&amp;nbsp;error&amp;nbsp;adding&amp;nbsp;symbols:&amp;nbsp;file&amp;nbsp;in&amp;nbsp;wrong&amp;nbsp;format
collect2:&amp;nbsp;error:&amp;nbsp;ld&amp;nbsp;returned&amp;nbsp;1&amp;nbsp;exit&amp;nbsp;status
make:&amp;nbsp;***&amp;nbsp;[Makefile:308:&amp;nbsp;sapi/cli/php]&amp;nbsp;Error&amp;nbsp;1
========================================================
ERROR:&amp;nbsp;php-8.2.33&amp;nbsp;install&amp;nbsp;failed.&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;code&gt;file in wrong format&lt;/code&gt; 这个报错看着吓人，其实意思很直接：链接器拿到的某个库，架构跟当前机器对不上。这篇讲怎么定位是哪个库、为什么会这样。&lt;/p&gt;&lt;h2 style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 21px; line-height: 1.4;&quot;&gt;报错在说什么&lt;/h2&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;PHP 编译分两步：先把一个个源文件编译成 &lt;code&gt;.o&lt;/code&gt; 目标文件，再由链接器 &lt;code&gt;ld&lt;/code&gt; 把这些目标文件和各种依赖库（curl、openssl、ICU 等）拼到一起，生成最终的 &lt;code&gt;php&lt;/code&gt; 可执行文件。&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;报错发生在链接阶段，点名了 &lt;code&gt;/usr/local/curl_2/lib/libcurl.so&lt;/code&gt;。&lt;code&gt;error adding symbols: file in wrong format&lt;/code&gt; 表示这个库的二进制格式不对——在 aarch64 机器上，大概率是这个库其实是 x86_64 的，链接器没法把 x86 的代码拼进 ARM 的程序。&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792673384143_imp_1792673352004_04-arm-library-mismatch.png&quot; alt=&quot;x86 依赖库无法链接进 ARM 程序。&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;figcaption style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;x86 依赖库无法链接进 ARM 程序。&lt;/figcaption&gt;&lt;/figure&gt;&lt;h2 style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 21px; line-height: 1.4;&quot;&gt;第一步：确认库的架构&lt;/h2&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;用 file 直接看这个库：&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792673390902_imp_1792673379323_a5-find-library.png&quot; alt=&quot;沿着报错路径检查依赖库的实际架构。&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;figcaption style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;沿着报错路径检查依赖库的实际架构。&lt;/figcaption&gt;&lt;/figure&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;file&amp;nbsp;/usr/local/curl_2/lib/libcurl.so&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;如果输出里写 &lt;code&gt;x86-64&lt;/code&gt;，而机器是 aarch64，问题就坐实了：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;uname&amp;nbsp;-m&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;aarch64&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;一个 x86 的库出现在 ARM 机器上，通常是这么来的：&lt;/p&gt;&lt;ul style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;以前某次安装，下载/解压了错误架构的预编译包（和面板在 ARM 上拿不到正确包、回退逻辑混乱有关）；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;手动装依赖时，从 x86 的来源拷了一份；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;旧系统残留的目录没清干净，编译脚本按路径找到了它。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;我这台机器上 &lt;code&gt;/usr/local/curl_2/&lt;/code&gt; 就是一份架构不对的 curl，PHP 配置时把它的 lib 路径加进了链接搜索路径，于是链接到了错误的库。&lt;/p&gt;&lt;h2 style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 21px; line-height: 1.4;&quot;&gt;第二步：看程序到底链接了哪些库&lt;/h2&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;code&gt;ldd&lt;/code&gt; 能列出一个可执行文件（或库）依赖的所有动态库及路径：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;#&amp;nbsp;看已经编出的&amp;nbsp;php（如果有）依赖了什么
ldd&amp;nbsp;/www/server/php/82/bin/php

#&amp;nbsp;只看&amp;nbsp;curl&amp;nbsp;/&amp;nbsp;icu&amp;nbsp;/&amp;nbsp;sodium&amp;nbsp;相关
ldd&amp;nbsp;/www/server/php/82/bin/php&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;-E&amp;nbsp;&amp;#39;curl|icu|sodium&amp;#39;

#&amp;nbsp;看有没有找不到的库
ldd&amp;nbsp;/www/server/php/82/bin/php&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;&amp;#39;not&amp;nbsp;found&amp;#39;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;编译中途失败、还没有最终 php 时，可以直接对那个出问题的库做检查，并全盘搜一下有没有多个同名库：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;#&amp;nbsp;全盘找&amp;nbsp;libcurl，看各自路径
find&amp;nbsp;/&amp;nbsp;-name&amp;nbsp;&amp;quot;libcurl.so*&amp;quot;&amp;nbsp;2&amp;gt;/dev/null

#&amp;nbsp;逐个&amp;nbsp;file&amp;nbsp;看架构
find&amp;nbsp;/&amp;nbsp;-name&amp;nbsp;&amp;quot;libcurl.so*&amp;quot;&amp;nbsp;2&amp;gt;/dev/null&amp;nbsp;-exec&amp;nbsp;file&amp;nbsp;{}&amp;nbsp;\;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;这样能把&amp;quot;正确的 ARM 库在哪、错误的 x86 库在哪&amp;quot;都列出来。&lt;/p&gt;&lt;h2 style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 21px; line-height: 1.4;&quot;&gt;第三步：清掉错误的库，让它用正确的&lt;/h2&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;思路是让链接器找到 aarch64 的库，而不是那份 x86 的。&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;strong style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;1. 删除或移走错误架构的目录&lt;/strong&gt;（确认没用后）：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;#&amp;nbsp;例：这份&amp;nbsp;curl&amp;nbsp;架构不对、也没被其他服务需要
sudo&amp;nbsp;rm&amp;nbsp;-rf&amp;nbsp;/usr/local/curl_2&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;strong style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;2. 用 apt 装 ARM 原生的依赖&lt;/strong&gt;，Ubuntu 源里的包一定匹配 aarch64：&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792673392172_imp_1792673385738_a5-native-libs.png&quot; alt=&quot;换成 ARM 原生依赖，清缓存后重新编译。&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;figcaption style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;换成 ARM 原生依赖，清缓存后重新编译。&lt;/figcaption&gt;&lt;/figure&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;sudo&amp;nbsp;apt&amp;nbsp;update
sudo&amp;nbsp;apt&amp;nbsp;install&amp;nbsp;-y&amp;nbsp;libcurl4-openssl-dev&amp;nbsp;libssl-dev&amp;nbsp;\
&amp;nbsp;&amp;nbsp;libicu-dev&amp;nbsp;libsodium-dev&amp;nbsp;pkg-config&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;strong style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;3. 清掉残留的半成品编译目录，重新编译&lt;/strong&gt;。宝塔编译会在 PHP 版本目录留下缓存和 &lt;code&gt;.o&lt;/code&gt;，不清可能继续引用旧路径：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;sudo&amp;nbsp;rm&amp;nbsp;-rf&amp;nbsp;/www/server/php/82&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;然后回到面板重新点&amp;quot;安装 PHP 8.2&amp;quot;，这次配置阶段通过 pkg-config 找到的是 apt 装的 ARM 库，链接就不会再报格式错误。&lt;/p&gt;&lt;h2 style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 21px; line-height: 1.4;&quot;&gt;第四步：装好后验证&lt;/h2&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;/www/server/php/82/bin/php&amp;nbsp;-v
/www/server/php/82/bin/php&amp;nbsp;-m&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;-E&amp;nbsp;&amp;#39;curl|intl|sodium&amp;#39;

#&amp;nbsp;确认链接的都是正常库、没有&amp;nbsp;not&amp;nbsp;found
ldd&amp;nbsp;/www/server/php/82/bin/php&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;&amp;#39;not&amp;nbsp;found&amp;#39;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;最后一条没有输出，就说明所有依赖都正常解析了。&lt;/p&gt;&lt;h2 style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 21px; line-height: 1.4;&quot;&gt;通用的判断方法&lt;/h2&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;&lt;code&gt;file in wrong format&lt;/code&gt; 这类问题不限于 PHP，任何在 ARM 上编译/运行的程序都可能遇到，判断套路相同：&lt;/p&gt;&lt;ol style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;uname -m&lt;/code&gt; 确认当前架构；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;file &amp;lt;报错点名的库&amp;gt;&lt;/code&gt; 看它是什么架构；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;ldd&lt;/code&gt; / &lt;code&gt;find&lt;/code&gt; 把依赖和同名库都列出来对比；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;删掉错误架构的库，用系统包管理器（apt/yum）装对应架构的原生库；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;清编译缓存后重新编译。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 15px; line-height: 1.8;&quot;&gt;核心就一句：编译器和链接器不会骗人，&lt;code&gt;wrong format&lt;/code&gt; 九成是库的架构拿错了，顺着路径把那份错误架构的库揪出来即可。&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;/div&gt;</description><pubDate>Thu, 22 Oct 2026 20:50:56 +0800</pubDate></item><item><title>MySQL 迁移的三个坑：ibdata1、lower_case_table_names、socket</title><link>https://yjtv.top/?id=24</link><description>&lt;div class=&quot;wrap&quot; style=&quot;margin: 0px auto; padding: 0px 0px 40px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;div class=&quot;cover&quot; style=&quot;background: linear-gradient(135deg, rgb(15, 81, 50) 0%, rgb(25, 135, 84) 100%); color: rgb(255, 255, 255); padding: 34px 28px 28px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;p class=&quot;series&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;云服务器运维实战系列 · 第 4 篇（共 7 篇）&lt;/p&gt;&lt;/div&gt;&lt;section class=&quot;post&quot; style=&quot;background: rgb(255, 255, 255); margin: 26px 16px 0px; border-radius: 12px; padding: 8px 26px 26px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;article id=&quot;post4&quot; style=&quot;font-size: 16px; line-height: 1.8; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif;&quot;&gt;&lt;h1 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 26px; line-height: 1.4;&quot;&gt;MySQL 迁移的三个坑：ibdata1、lower_case_table_names、socket&lt;/h1&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;迁数据库时，我一开始图省事，想直接把旧机器的 MySQL 数据目录整个拷到新机器，结果服务怎么都起不来。对着错误日志一条条查，最后栽在三个地方：表空间文件、一个大小写参数、还有 socket 路径。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;这三个坑都不复杂，但每一个都会让 MySQL 在启动阶段直接退出。这篇把报错和解法记下来。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;坑一：直接拷 ibdata1，表空间初始化失败&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;我最初的做法是停掉 MySQL，把旧的数据目录（含 &lt;code&gt;ibdata1&lt;/code&gt;、&lt;code&gt;mysql&lt;/code&gt; 库、各业务库目录）复制到新机器的 &lt;code&gt;/var/lib/mysql&lt;/code&gt;，然后启动。错误日志立刻报：&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792661488117_imp_1792661480165_a4-ibdata.png&quot; alt=&quot;复制物理数据目录，版本差异可能导致启动失败。&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;复制物理数据目录，版本差异可能导致启动失败。&lt;/figcaption&gt;&lt;/figure&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Text&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Text&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;[ERROR]&amp;nbsp;[InnoDB]&amp;nbsp;The&amp;nbsp;Auto-extending&amp;nbsp;innodb_system&amp;nbsp;data&amp;nbsp;file&amp;nbsp;&amp;#39;./ibdata1&amp;#39;&amp;nbsp;is&amp;nbsp;of&amp;nbsp;a&amp;nbsp;different
size&amp;nbsp;...&amp;nbsp;than&amp;nbsp;specified&amp;nbsp;in&amp;nbsp;the&amp;nbsp;cnf&amp;nbsp;file:&amp;nbsp;initial&amp;nbsp;768&amp;nbsp;pages,&amp;nbsp;max&amp;nbsp;0&amp;nbsp;...
[ERROR]&amp;nbsp;[InnoDB]&amp;nbsp;Plugin&amp;nbsp;initialization&amp;nbsp;aborted&amp;nbsp;with&amp;nbsp;error&amp;nbsp;Generic&amp;nbsp;error.
[ERROR]&amp;nbsp;[Server]&amp;nbsp;Failed&amp;nbsp;to&amp;nbsp;initialize&amp;nbsp;DD&amp;nbsp;Storage&amp;nbsp;Engine
[ERROR]&amp;nbsp;[Server]&amp;nbsp;Data&amp;nbsp;Dictionary&amp;nbsp;initialization&amp;nbsp;failed.
[ERROR]&amp;nbsp;[Server]&amp;nbsp;Aborting&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;code&gt;ibdata1&lt;/code&gt; 是 InnoDB 的系统表空间文件，里面有数据字典、change buffer 等关键信息。它的初始大小、页结构、内部记录的格式，跟 MySQL 版本、编译参数、配置强相关。我新旧两边 MySQL 小版本不同（一边 8.0.45、一边 8.0.46），文件对不上，InnoDB 读到的结构和它预期的不一致，直接拒绝初始化。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;我一度想靠在配置里写 &lt;code&gt;innodb_data_file_path = ibdata1:10M:autoextend&lt;/code&gt; 去对齐，但这个参数是初始化时定的，对一个已经存在、内容不匹配的文件没用，反而因为重定向写错位置（没加 sudo、文件落到了 /root）白折腾。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;结论：物理拷贝数据目录这条路，跨版本、跨架构基本走不通。&lt;/strong&gt; 正确做法是逻辑迁移（见文末）。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;坑二：lower_case_table_names 必须初始化前定&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;解决了表空间，又冒出新报错：&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792661501041_imp_1792661487570_a4-case.png&quot; alt=&quot;新库初始化之前就要对齐表名大小写设置。&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;新库初始化之前就要对齐表名大小写设置。&lt;/figcaption&gt;&lt;/figure&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Text&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Text&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;[ERROR]&amp;nbsp;[Server]&amp;nbsp;Different&amp;nbsp;lower_case_table_names&amp;nbsp;settings&amp;nbsp;for&amp;nbsp;server&amp;nbsp;(&amp;#39;0&amp;#39;)&amp;nbsp;and&amp;nbsp;data&amp;nbsp;dictionary&amp;nbsp;(&amp;#39;1&amp;#39;).
[ERROR]&amp;nbsp;[Server]&amp;nbsp;Data&amp;nbsp;Dictionary&amp;nbsp;initialization&amp;nbsp;failed.&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;code&gt;lower_case_table_names&lt;/code&gt; 控制库名、表名的大小写敏感：&lt;/p&gt;&lt;ul style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;0&lt;/code&gt;：按你创建时的大小写存，查询区分大小写（Linux 默认）；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;1&lt;/code&gt;：统一转小写存储，查询不区分大小写（Windows 默认）。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;关键点：&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;这个参数必须在 MySQL 数据目录初始化（initialize）之前就定好&lt;/strong&gt;，初始化之后不能改。旧数据字典里记录的是 &lt;code&gt;1&lt;/code&gt;，新服务器默认 &lt;code&gt;0&lt;/code&gt;，启动时一比对不一致，就拒绝启动。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;正确处理是在初始化阶段就指定，而不是等服务装完再改配置。如果是全新初始化：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;#&amp;nbsp;初始化时就带上参数（以实际配置方式为准）
sudo&amp;nbsp;mysqld&amp;nbsp;--initialize&amp;nbsp;--lower-case-table-names=1&amp;nbsp;...&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;我这边是导入已有数据，需要让新实例和旧实例保持一致：在配置文件 &lt;code&gt;/etc/mysql/mysql.conf.d/mysqld.cnf&lt;/code&gt; 的 &lt;code&gt;[mysqld]&lt;/code&gt; 段加上：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;ini&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;INI&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;lower_case_table_names&amp;nbsp;=&amp;nbsp;1&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;但务必在数据目录初始化/导入前设置；数据字典已经按 &lt;code&gt;0&lt;/code&gt; 建好之后再改，同样起不来。改之前先确认旧库这个值：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;#&amp;nbsp;旧机器上查
mysql&amp;nbsp;-e&amp;nbsp;&amp;quot;SHOW&amp;nbsp;VARIABLES&amp;nbsp;LIKE&amp;nbsp;&amp;#39;lower_case_table_names&amp;#39;;&amp;quot;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;坑三：socket 路径对不上&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;服务好不容易起来了，命令行连接又报：&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792661513180_imp_1792661501675_a4-socket.png&quot; alt=&quot;核对服务状态与 socket 路径，必要时改走 TCP。&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;核对服务状态与 socket 路径，必要时改走 TCP。&lt;/figcaption&gt;&lt;/figure&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Text&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Text&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;ERROR&amp;nbsp;2002&amp;nbsp;(HY000):&amp;nbsp;Can&amp;#39;t&amp;nbsp;connect&amp;nbsp;to&amp;nbsp;local&amp;nbsp;MySQL&amp;nbsp;server&amp;nbsp;through&amp;nbsp;socket
&amp;#39;/var/run/mysqld/mysqld.sock&amp;#39;&amp;nbsp;(2)&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;本地用 &lt;code&gt;mysql&lt;/code&gt; 命令连接时，默认走 Unix socket 文件，路径编译时定死。报错末尾的 &lt;code&gt;(2)&lt;/code&gt; 是系统错误码 ENOENT，意思是这个 socket 文件不存在——要么服务没真正起来，要么实际 socket 在别的路径。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;排查顺序：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;#&amp;nbsp;1.&amp;nbsp;确认服务真的在运行
systemctl&amp;nbsp;status&amp;nbsp;mysql

#&amp;nbsp;2.&amp;nbsp;找实际的&amp;nbsp;socket&amp;nbsp;文件在哪
sudo&amp;nbsp;find&amp;nbsp;/&amp;nbsp;-name&amp;nbsp;&amp;quot;mysql*.sock&amp;quot;&amp;nbsp;2&amp;gt;/dev/null

#&amp;nbsp;3.&amp;nbsp;看配置里指定的&amp;nbsp;socket
grep&amp;nbsp;-rn&amp;nbsp;&amp;quot;socket&amp;quot;&amp;nbsp;/etc/mysql/&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;常见情况：&lt;/p&gt;&lt;ul style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;服务没起来（前两个坑没解决），socket 自然不存在——回到错误日志继续查；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;socket 在别的路径，连接时显式指定：&lt;code&gt;mysql -S /run/mysqld/mysqld.sock&lt;/code&gt;；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;或干脆走 TCP：&lt;code&gt;mysql -h 127.0.0.1 -P 3306 -u root -p&lt;/code&gt;。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;正确的迁移方式：逻辑导出导入&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;物理文件不能搬，就用 &lt;code&gt;mysqldump&lt;/code&gt; 把数据导成 SQL 文本，再到新库执行。文本不挑架构、不挑小版本，最稳：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;#&amp;nbsp;旧机器：导出（含建库、建表、触发器等）
mysqldump&amp;nbsp;-u&amp;nbsp;root&amp;nbsp;-p&amp;nbsp;--single-transaction&amp;nbsp;--routines&amp;nbsp;--triggers&amp;nbsp;--events&amp;nbsp;\
&amp;nbsp;&amp;nbsp;--databases&amp;nbsp;你的库名&amp;nbsp;&amp;gt;&amp;nbsp;backup.sql

#&amp;nbsp;拷贝&amp;nbsp;backup.sql&amp;nbsp;到新机器后导入
mysql&amp;nbsp;-u&amp;nbsp;root&amp;nbsp;-p&amp;nbsp;&amp;lt;&amp;nbsp;backup.sql&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;code&gt;--single-transaction&lt;/code&gt; 让 InnoDB 在不锁表的情况下拿到一致性快照；&lt;code&gt;--routines --triggers --events&lt;/code&gt; 把存储过程、触发器、定时事件也带上。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;迁移前的检查清单&lt;/h2&gt;&lt;ol style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;新旧都查 &lt;code&gt;SELECT VERSION();&lt;/code&gt;，大版本一致（同为 8.0）最稳；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;新旧都查 &lt;code&gt;lower_case_table_names&lt;/code&gt;，新实例初始化前就设成一致；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;用 &lt;code&gt;mysqldump&lt;/code&gt; 导出，不复制 ibdata1 和数据目录；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;导入后核对库表数量，再验证站点连接；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;连不上先看 &lt;code&gt;systemctl status mysql&lt;/code&gt; 和错误日志，再区分是服务没起还是 socket 路径问题。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;数据库迁移，搬的是逻辑数据，不是物理文件——这一条记住，能省掉大半天对着启动报错发呆。&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;div class=&quot;footer&quot; style=&quot; color: rgb(154, 160, 168); font-size: 16px; margin: 28px 16px 0px; line-height: 1.8; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif;&quot;&gt;本系列基于真实运维操作整理，文中 IP / 域名 / 账号 / 密码等信息均已脱敏。&lt;/div&gt;&lt;/div&gt;</description><pubDate>Thu, 22 Oct 2026 17:32:02 +0800</pubDate></item><item><title>宝塔面板在 Ubuntu 上装不上 MySQL：日志显示&amp;quot;执行成功&amp;quot;，软件却没装上</title><link>https://yjtv.top/?id=23</link><description>&lt;div class=&quot;wrap&quot; style=&quot; margin: 0px auto; padding: 0px 0px 40px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;div class=&quot;cover&quot; style=&quot;background: linear-gradient(135deg, rgb(15, 81, 50) 0%, rgb(25, 135, 84) 100%); color: rgb(255, 255, 255); padding: 34px 28px 28px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;p class=&quot;series&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;云服务器运维实战系列 · 第 3 篇（共 7 篇）&lt;/p&gt;&lt;/div&gt;&lt;section class=&quot;post&quot; style=&quot;background: rgb(255, 255, 255); margin: 26px 16px 0px; border-radius: 12px; padding: 8px 26px 26px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;article id=&quot;post3&quot; style=&quot;font-size: 16px; line-height: 1.8; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif;&quot;&gt;&lt;h1 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 26px; line-height: 1.4;&quot;&gt;宝塔面板在 Ubuntu 上装不上 MySQL：日志显示&amp;quot;执行成功&amp;quot;，软件却没装上&lt;/h1&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;在宝塔面板里点&amp;quot;安装 MySQL 8.0&amp;quot;，任务跑了一会儿，最后提示执行成功。可回到软件列表，MySQL 还是未安装，网站连不上数据库。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;更怪的是，日志里反复刷 &lt;code&gt;cat: /etc/redhat-release: No such file or directory&lt;/code&gt;，然后照样来一句&amp;quot;命令已执行&amp;quot;。这篇讲清楚这是怎么回事，以及在 ARM + Ubuntu 上怎么把 MySQL 真正装上。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;先看现象&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;安装日志的关键片段：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Text&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Text&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;正在选择下载节点...
--2026-10-02&amp;nbsp;...&amp;nbsp;https://cf1-node.aapanel.com/install/0/mysql.sh
...
cat:&amp;nbsp;/etc/redhat-release:&amp;nbsp;No&amp;nbsp;such&amp;nbsp;file&amp;nbsp;or&amp;nbsp;directory
cat:&amp;nbsp;/etc/redhat-release:&amp;nbsp;No&amp;nbsp;such&amp;nbsp;file&amp;nbsp;or&amp;nbsp;directory
|-Successify&amp;nbsp;---&amp;nbsp;命令已执行!&amp;nbsp;---&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;脚本最后报&amp;quot;成功&amp;quot;，但：&lt;/p&gt;&lt;ul style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;软件商店 / 已安装列表里没有 MySQL；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;mysql&lt;/code&gt; 命令不存在或服务起不来；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;网站报数据库连接失败。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;任务列表里这条记录往往标着&amp;quot;安装失败&amp;quot;，耗时只有几秒到十几秒。&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792660916696_imp_1792660907349_a3-success-log.png&quot; alt=&quot;脚本显示执行成功，不等于 MySQL 安装完成。&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;脚本显示执行成功，不等于 MySQL 安装完成。&lt;/figcaption&gt;&lt;/figure&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第一步：确认系统和架构&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;那句 &lt;code&gt;cat: /etc/redhat-release&lt;/code&gt; 是线索。宝塔安装脚本里有一段要判断系统版本，它习惯去读红帽系（CentOS/RHEL）的 &lt;code&gt;/etc/redhat-release&lt;/code&gt;。在 Debian/Ubuntu 上这个文件不存在，于是报错——脚本对 Debian/Ubuntu 的适配做得不完整。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;先确认自己的系统：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;cat&amp;nbsp;/etc/os-release
#&amp;nbsp;例如：Ubuntu&amp;nbsp;22.04.3&amp;nbsp;LTS

uname&amp;nbsp;-m
#&amp;nbsp;aarch64&amp;nbsp;表示&amp;nbsp;ARM；x86_64&amp;nbsp;表示常见的&amp;nbsp;Intel/AMD&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;我这台是 Ubuntu 22.04、aarch64（甲骨文免费 Ampere）。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第二步：看真正的安装日志&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;面板消息盒子里那句&amp;quot;命令已执行&amp;quot;只是脚本跑完了，不代表装成功。要点&amp;quot;详情&amp;quot;看完整输出，或者看面板的安装日志文件，重点找：&lt;/p&gt;&lt;ul style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;有没有 &lt;code&gt;ERROR&lt;/code&gt;、&lt;code&gt;make: *** Error&lt;/code&gt;、&lt;code&gt;No package&lt;/code&gt;、&lt;code&gt;404 Not Found&lt;/code&gt;；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;是&amp;quot;下载二进制包&amp;quot;还是&amp;quot;开始源码编译&amp;quot;。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;宝塔对主流 x86 系统，通常直接下载预编译好的包，解压即用，几分钟搞定。而在 ARM 上，情况不一样。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;根因：架构 + 脚本两个问题叠在一起&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;1. 没有匹配架构的预编译包。&lt;/strong&gt; 宝塔的预编译包主要面向 x86_64。到了 aarch64，下载节点找不到对应包，脚本往往回退成&amp;quot;源码编译&amp;quot;——日志里会刷大量 &lt;code&gt;Building CXX object ...&lt;/code&gt;、&lt;code&gt;[xx%]&lt;/code&gt;。&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792660927077_imp_1792660912539_a3-arch-reason.png&quot; alt=&quot;ARM 缺少预编译包，可能回退到源码编译。&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;ARM 缺少预编译包，可能回退到源码编译。&lt;/figcaption&gt;&lt;/figure&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;2. 源码编译 MySQL 极慢且容易失败。&lt;/strong&gt; MySQL 是几百万行级别的 C++ 工程，免费 ARM 实例上编译要很久，内存、依赖（cmake、gcc、各种 dev 库）稍有不足就中断。我这边编译卡在 20% 多反复失败，面板最终判定安装失败。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;3. 脚本对 Ubuntu 适配不完整。&lt;/strong&gt; 反复读 &lt;code&gt;/etc/redhat-release&lt;/code&gt; 就是表现之一。它按红帽系的路径和判断逻辑走，在 Ubuntu 上会留下各种无效报错。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;所以这不是&amp;quot;系统不干净&amp;quot;，而是架构和脚本适配问题。换个角度：面板里点安装，本质也是执行它下载的 shell 脚本，脚本没处理好 ARM + Ubuntu，再点几次结果一样。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;怎么真正装上&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;在 ARM + Ubuntu 上，最省心的是&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;直接用 Ubuntu 官方源装 MySQL&lt;/strong&gt;，不依赖宝塔的预编译包：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;sudo&amp;nbsp;apt&amp;nbsp;update
sudo&amp;nbsp;apt&amp;nbsp;install&amp;nbsp;-y&amp;nbsp;mysql-server&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Ubuntu 22.04 官方源里的 MySQL 是匹配 aarch64 的，apt 会自动装好服务并设置开机自启。装完验证：&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792660932619_imp_1792660918894_a3-apt-way.png&quot; alt=&quot;使用 Ubuntu ARM 系统源安装并验证服务。&quot; referrerpolicy=&quot;no-referrer&quot;/&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;使用 Ubuntu ARM 系统源安装并验证服务。&lt;/figcaption&gt;&lt;/figure&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;systemctl&amp;nbsp;status&amp;nbsp;mysql&amp;nbsp;--no-pager
sudo&amp;nbsp;mysql&amp;nbsp;-e&amp;nbsp;&amp;quot;SELECT&amp;nbsp;VERSION();&amp;quot;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;需要注意：&lt;/p&gt;&lt;ul style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;Ubuntu 源里的 MySQL 默认用 &lt;code&gt;auth_socket&lt;/code&gt; 插件，root 在本机可以直接 &lt;code&gt;sudo mysql&lt;/code&gt; 免密登录，设置密码和远程访问要另外处理（数据迁移那篇会讲）；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;版本可能不是宝塔默认的 8.0 某个小版本，但同属 8.0，数据格式兼容；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;装完宝塔面板一般能识别到系统里的 MySQL；若软件商店仍显示未安装，可在面板&amp;quot;数据库&amp;quot;里手动连接，或重启面板。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;如果一定要用宝塔管理的那份，也可以在面板里选&amp;quot;编译安装&amp;quot;并耐心等它编完（可能数十分钟到数小时），期间别中断；但既然官方源有现成的 ARM 包，没必要硬等编译。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;顺带说一句 PHP&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;同一台机器上，PHP 8.2 用面板编译也失败过，报错指向依赖库架构不对（&lt;code&gt;file in wrong format&lt;/code&gt;）；而 PHP 7.4 能装上。这同样是 ARM 适配问题，我单独写了一篇。遇到&amp;quot;某个版本死活装不上&amp;quot;，先换个版本或换 apt 源，通常比反复点安装更有效。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;排查顺序小结&lt;/h2&gt;&lt;ol style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;cat /etc/os-release&lt;/code&gt;、&lt;code&gt;uname -m&lt;/code&gt;，确认是 Ubuntu + ARM；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;看完整安装日志，确认是&amp;quot;找不到预编译包 → 回退源码编译 → 编译失败&amp;quot;；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;不死磕面板，改用 &lt;code&gt;sudo apt install mysql-server&lt;/code&gt; 装官方 ARM 包；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;装好后再处理 root 密码、数据导入和面板识别。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/article&gt;&lt;/section&gt;&lt;/div&gt;</description><pubDate>Thu, 22 Oct 2026 17:22:37 +0800</pubDate></item><item><title>甲骨文云服务器运维实战系列云盘扩容 50G→150G</title><link>https://yjtv.top/?id=22</link><description>&lt;div class=&quot;wrap&quot; style=&quot; margin: 0px auto; padding: 0px 0px 40px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;div class=&quot;cover&quot; style=&quot;background: linear-gradient(135deg, rgb(15, 81, 50) 0%, rgb(25, 135, 84) 100%); color: rgb(255, 255, 255); padding: 34px 28px 28px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;p class=&quot;series&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;云服务器运维实战系列 · 第 2 篇（共 7 篇）&lt;/p&gt;&lt;/div&gt;&lt;section class=&quot;post&quot; style=&quot;background: rgb(255, 255, 255); margin: 26px 16px 0px; border-radius: 12px; padding: 8px 26px 26px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;article id=&quot;post2&quot; style=&quot;font-size: 16px; line-height: 1.8; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif;&quot;&gt;&lt;h1 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 26px; line-height: 1.4;&quot;&gt;云盘扩容 50G→150G：控制台改完，为什么系统里还是老大小&lt;/h1&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;迁到免费 ARM 实例后，默认系统盘只有 50G。眼下占用不高，但后面要装环境、跑数据库、留备份，我决定把它扩到 150G。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;扩容时最容易懵的一点：控制台明明把盘改大了，登录机器一看，&lt;code&gt;df&lt;/code&gt; 里还是老大小。这不是没生效，是中间还有两层没打通。这篇把完整步骤走一遍，全程不关机、业务不中断。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;扩容到底在扩哪几层&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;一块云盘从物理容量到你能存文件，隔着三层，要逐层打通：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Text&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Text&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;云平台上的卷（Volume）&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;——&amp;nbsp;控制台把&amp;nbsp;50G&amp;nbsp;改成&amp;nbsp;150G
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;↓
系统看到的磁盘&amp;nbsp;/dev/sda&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;——&amp;nbsp;让内核重新识别磁盘大小
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;↓
分区&amp;nbsp;/dev/sda1&amp;nbsp;+&amp;nbsp;文件系统&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;——&amp;nbsp;扩分区，再扩文件系统（ext4）&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;只做第一层，可用空间不会变，因为分区和文件系统还停在旧尺寸。&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792660096382_imp_1792660070249_02-cloud-disk-layers.png&quot; alt=&quot;云卷、磁盘、分区和文件系统要逐层扩展。&quot;/&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;云卷、磁盘、分区和文件系统要逐层扩展。&lt;/figcaption&gt;&lt;/figure&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第一层：控制台改大小&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;在控制台找到引导卷，编辑容量，50G 改成 150G。几点：&lt;/p&gt;&lt;ul style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;主流云都支持运行中在线扩引导卷，不用关机，网站不受影响；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;只改容量，其他别动&lt;/strong&gt;：性能档位（甲骨文叫 VPU，默认 10）、加密、跨区域复制保持原样，免得影响性能或产生费用；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;容量只能调大、不能调回，想清楚再填。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;提交后卷已经是 150G，但机器里还看不到。&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792660102573_imp_1792660095246_a2-volume.png&quot; alt=&quot;控制台扩容后，来宾系统还要重新识别容量。&quot;/&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;控制台扩容后，来宾系统还要重新识别容量。&lt;/figcaption&gt;&lt;/figure&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第二层：让内核重新扫描磁盘&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;扩容后操作系统未必立刻感知，需要触发一次重新扫描。甲骨文控制台扩容弹窗里会给出命令，核心是这两条：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;#&amp;nbsp;对引导盘做一次只读探测，让内核重新读容量
sudo&amp;nbsp;dd&amp;nbsp;iflag=direct&amp;nbsp;if=/dev/oracleoci/oraclevda&amp;nbsp;of=/dev/null&amp;nbsp;count=1

#&amp;nbsp;向&amp;nbsp;SCSI&amp;nbsp;设备的&amp;nbsp;rescan&amp;nbsp;接口写&amp;nbsp;1，触发重新扫描
echo&amp;nbsp;&amp;quot;1&amp;quot;&amp;nbsp;|&amp;nbsp;sudo&amp;nbsp;tee&amp;nbsp;/sys/class/block/$(readlink&amp;nbsp;/dev/oracleoci/oraclevda&amp;nbsp;|&amp;nbsp;cut&amp;nbsp;-d&amp;#39;/&amp;#39;)/device/rescan&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;code&gt;/dev/oracleoci/oraclevda&lt;/code&gt; 是甲骨文对引导盘的固定别名，等价 &lt;code&gt;/dev/sda&lt;/code&gt;。其他云、或盘名不同时，通用做法是往 &lt;code&gt;/sys/class/block/&amp;lt;盘名&amp;gt;/device/rescan&lt;/code&gt; 写 1；嫌麻烦，重启一次实例也能识别。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;扫描后确认磁盘层面已变大：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;lsblk
#&amp;nbsp;或
sudo&amp;nbsp;fdisk&amp;nbsp;-l&amp;nbsp;/dev/sda&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;这时 &lt;code&gt;sda&lt;/code&gt; 整体已是 150G，但分区 &lt;code&gt;sda1&lt;/code&gt; 可能还显示约 50G——接着做第三层。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第三层：扩分区（growpart）&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;用 growpart 把第 1 个分区扩到占满整块盘：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;sudo&amp;nbsp;growpart&amp;nbsp;/dev/sda&amp;nbsp;1&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;code&gt;/dev/sda&lt;/code&gt; 和分区号 &lt;code&gt;1&lt;/code&gt; 之间有空格，意思是扩 sda 的第 1 个分区。成功会输出类似：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Text&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Text&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;CHANGED:&amp;nbsp;partition=1&amp;nbsp;start=...&amp;nbsp;old:&amp;nbsp;size=...&amp;nbsp;new:&amp;nbsp;size=...&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;提示 command not found 就先装：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;sudo&amp;nbsp;apt&amp;nbsp;update&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;sudo&amp;nbsp;apt&amp;nbsp;install&amp;nbsp;-y&amp;nbsp;cloud-guest-utils&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;第四层：扩文件系统（resize2fs）&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;分区大了，里面的文件系统（Ubuntu 默认 ext4）还不知道，最后在线扩一下：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;sudo&amp;nbsp;resize2fs&amp;nbsp;/dev/sda1&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;ext4 支持挂载状态下在线扩容，不用卸载、不影响业务。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;如果是 xfs 文件系统，对应命令是 &lt;code&gt;sudo xfs_growfs /&lt;/code&gt;（按挂载点），别用 resize2fs。&lt;code&gt;df -T&lt;/code&gt; 能看文件系统类型。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;验证&lt;/h2&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Bash&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Bash&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;df&amp;nbsp;-h&amp;nbsp;/&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;实际结果：&lt;/p&gt;&lt;div class=&quot;code-block-wrap&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;span class=&quot;code-lang-badge&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;Text&lt;/span&gt;&lt;div style=&quot;position:relative;margin:0 0 16px;&quot;&gt;&lt;span style=&quot;position:absolute;top:9px;right:12px;font-size:11px;line-height:1;color:#8b949e;background:rgba(0,0,0,.05);padding:4px 8px;border-radius:4px;font-family:Consolas, &quot;&gt;Text&lt;/span&gt;&lt;pre style=&quot;background:#f6f8fa;border:1px solid #e1e4e8;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:0 0 16px;font-family:Consolas, &quot;&gt;Filesystem&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Size&amp;nbsp;&amp;nbsp;Used&amp;nbsp;Avail&amp;nbsp;Use%&amp;nbsp;Mounted&amp;nbsp;on
/dev/sda1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;146G&amp;nbsp;&amp;nbsp;9.9G&amp;nbsp;&amp;nbsp;136G&amp;nbsp;&amp;nbsp;&amp;nbsp;7%&amp;nbsp;/&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;code&gt;Size&lt;/code&gt; 从约 49G 变成 146G（标称 150G，文件系统略小是分区表和元数据占用，正常），可用约 136G。&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;margin: 26px auto 30px; max-width: 680px;  font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/1792660106564_imp_1792660099376_a2-partition-fs.png&quot; alt=&quot;扩分区与文件系统后，验证可用空间。&quot;/&gt;&lt;figcaption style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;扩分区与文件系统后，验证可用空间。&lt;/figcaption&gt;&lt;/figure&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;免费配额会不会超&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;用免费套餐，这步必须算清楚。按甲骨文&amp;quot;永久免费&amp;quot;文档，存储免费额度是：&lt;/p&gt;&lt;ul style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;块卷 + 引导卷合计 200GB，永久免费&lt;/strong&gt;，且只在账号的&amp;quot;主区域&amp;quot;；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;另有 &lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;5 个免费卷备份&lt;/strong&gt;名额。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;50G 扩到 150G 后：已用 150G，额度 200G，&lt;strong style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;还剩 50G，不超标&lt;/strong&gt;。&lt;/p&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;两个容易忽略的点：&lt;/p&gt;&lt;ol style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;免费额度按主区域算，卷要在主区域才计入；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;我没给卷做手动快照，5 个免费卷备份名额仍空着（数据库的 &lt;code&gt;.sql&lt;/code&gt; 备份是文件，不算卷备份）。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;操作前后都建议到官方免费资源页核对一遍，政策偶尔调整，以最新文档为准。&lt;/p&gt;&lt;h2 style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 22px; line-height: 1.4;&quot;&gt;顺序回顾&lt;/h2&gt;&lt;p style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-size: 16px; line-height: 1.8;&quot;&gt;控制台改大小 → 内核 rescan（或重启）→ growpart 扩分区 → resize2fs（xfs 用 xfs_growfs）扩文件系统 → df 验证，再核对一遍免费配额。&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;div class=&quot;footer&quot; style=&quot; color: rgb(154, 160, 168); font-size: 16px; margin: 28px 16px 0px; line-height: 1.8; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif;&quot;&gt;本系列基于真实运维操作整理，文中 IP / 域名 / 账号 / 密码等信息均已脱敏。&lt;/div&gt;&lt;/div&gt;</description><pubDate>Thu, 22 Oct 2026 17:11:06 +0800</pubDate></item><item><title>甲骨文云免费 ARM 服务器：从 x86 迁到 ARM，&amp;quot;换块硬盘&amp;quot;为什么行不通</title><link>https://yjtv.top/?id=19</link><description>&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;旧服务器要下线，我打算把站点搬到甲骨文云的免费 ARM 实例上。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;动手前以为这会很轻松——云控制台点几下，把旧系统盘挂到新机器，系统、网站、数据库不就都继承了。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;结果在第一步就卡住。这篇记录的就是这个卡点，以及为什么它在 x86 到 ARM 这条路上无解。&lt;/p&gt;&lt;h2 style=&quot;box-sizing: border-box; font-size: 18px; margin: 30px 0px 12px; padding-left: 11px; border-left: 4px solid rgb(25, 135, 84); color: rgb(17, 17, 17); line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;两台机器，两种 CPU&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;迁移涉及两台实例：&lt;/p&gt;&lt;table width=&quot;676&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;box-sizing: border-box;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;box-sizing: border-box; border-color: rgb(216, 220, 225); padding: 8px 11px; text-align: left; vertical-align: top; background: rgb(242, 244, 247);&quot;&gt;&lt;br/&gt;&lt;/th&gt;&lt;th style=&quot;box-sizing: border-box; border-color: rgb(216, 220, 225); padding: 8px 11px; text-align: left; vertical-align: top; background: rgb(242, 244, 247);&quot;&gt;旧实例（已下线）&lt;/th&gt;&lt;th style=&quot;box-sizing: border-box; border-color: rgb(216, 220, 225); padding: 8px 11px; text-align: left; vertical-align: top; background: rgb(242, 244, 247);&quot;&gt;新实例（免费套餐，现用）&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; border-color: rgb(216, 220, 225); padding: 8px 11px; vertical-align: top;&quot;&gt;CPU&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; border-color: rgb(216, 220, 225); padding: 8px 11px; vertical-align: top;&quot;&gt;AMD，&lt;strong style=&quot;box-sizing: border-box; color: rgb(17, 17, 17);&quot;&gt;x86_64&lt;/strong&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; border-color: rgb(216, 220, 225); padding: 8px 11px; vertical-align: top;&quot;&gt;Ampere，&lt;strong style=&quot;box-sizing: border-box; color: rgb(17, 17, 17);&quot;&gt;ARM（aarch64）&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; border-color: rgb(216, 220, 225); padding: 8px 11px; vertical-align: top;&quot;&gt;系统&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; border-color: rgb(216, 220, 225); padding: 8px 11px; vertical-align: top;&quot;&gt;Ubuntu（x86_64）&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; border-color: rgb(216, 220, 225); padding: 8px 11px; vertical-align: top;&quot;&gt;Ubuntu 22.04（aarch64）&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; border-color: rgb(216, 220, 225); padding: 8px 11px; vertical-align: top;&quot;&gt;系统盘&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; border-color: rgb(216, 220, 225); padding: 8px 11px; vertical-align: top;&quot;&gt;150G 引导卷&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; border-color: rgb(216, 220, 225); padding: 8px 11px; vertical-align: top;&quot;&gt;50G 引导卷&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;甲骨文&amp;quot;永久免费&amp;quot;套餐里最值得用的就是 Ampere ARM 实例：最多 4 核、24G 内存，个人站点绰绰有余。CPU 和内存是配比关系（合计 4 OCPU / 24G），可以拆成 1 核 6G、2 核 12G 等，按需选。&lt;/p&gt;&lt;h2 style=&quot;box-sizing: border-box; font-size: 18px; margin: 30px 0px 12px; padding-left: 11px; border-left: 4px solid rgb(25, 135, 84); color: rgb(17, 17, 17); line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;想走的捷径&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;最省事的思路，是把旧机器那块 150G 系统盘直接挂到新机器上启动。云平台上这个操作叫&amp;quot;替换引导卷&amp;quot;：关机、分离当前引导卷、把旧卷作为引导卷挂上、开机。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;我已经把旧卷先当&lt;strong style=&quot;box-sizing: border-box; color: rgb(17, 17, 17);&quot;&gt;数据盘&lt;/strong&gt;附加到新实例（Linux 里识别为第二块盘），打算确认下里面的内容再动手。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;幸好先看了一眼。&lt;/p&gt;&lt;h2 style=&quot;box-sizing: border-box; font-size: 18px; margin: 30px 0px 12px; padding-left: 11px; border-left: 4px solid rgb(25, 135, 84); color: rgb(17, 17, 17); line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;一条 file 命令，问题就清楚了&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;挂载旧盘后，我对旧系统里最核心的 &lt;code style=&quot;box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; background: rgb(243, 244, 246); color: rgb(199, 37, 78); padding: 2px 6px; border-radius: 5px; font-size: 13.5px;&quot;&gt;/bin/bash&lt;/code&gt; 做了次检查：&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; background: rgb(31, 35, 40); color: rgb(230, 237, 243); padding: 16px 18px; border-radius: 10px; overflow-x: auto; margin: 16px 0px; line-height: 1.6; font-size: 15.5px;&quot;&gt;#&amp;nbsp;旧盘挂载在&amp;nbsp;/mnt/oldroot
file&amp;nbsp;/mnt/oldroot/bin/bash&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;输出：&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; background: rgb(31, 35, 40); color: rgb(230, 237, 243); padding: 16px 18px; border-radius: 10px; overflow-x: auto; margin: 16px 0px; line-height: 1.6; font-size: 15.5px;&quot;&gt;/mnt/oldroot/bin/bash:&amp;nbsp;ELF&amp;nbsp;64-bit&amp;nbsp;LSB&amp;nbsp;shared&amp;nbsp;object,&amp;nbsp;x86-64,&amp;nbsp;version&amp;nbsp;1&amp;nbsp;(SYSV),
dynamically&amp;nbsp;linked,&amp;nbsp;interpreter&amp;nbsp;/lib64/ld-linux-x86-64.so.2&amp;nbsp;...&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; background: rgb(243, 244, 246); color: rgb(199, 37, 78); padding: 2px 6px; border-radius: 5px; font-size: 13.5px;&quot;&gt;x86-64&lt;/code&gt;。旧盘里的程序全是给 x86 编译的。&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;box-sizing: border-box; margin: 26px auto 30px; max-width: 680px; text-align: left; color: rgb(36, 41, 47); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&lt;p id=&quot;_img_parent_tmp&quot;&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://img.yjtv.top/file/blog/1791159001237_image.png&quot; width=&quot;681&quot; height=&quot;370&quot; style=&quot;width: 681px; height: 370px; float: left;&quot;/&gt;&lt;/p&gt;&lt;img src=&quot;https://yjtv.top/zb_users/plugin/UEditor/themes/default/images/spacer.gif&quot; alt=&quot;先确认可执行文件架构，旧盘不能直接启动。&quot; style=&quot;background:url(https://yjtv.top/zb_users/plugin/UEditor/lang/zh-cn/images/localimage.png) no-repeat center center;border:1px solid #ddd&quot; word_img=&quot;file:///C:/Users/Admin/Documents/Codex/2026-10-03/use-ian-xiaohei-illustrations-7-5/outputs/images/a1-file-signature.png&quot;/&gt;&lt;figcaption style=&quot;box-sizing: border-box; margin-top: 8px; color: rgb(107, 114, 128); font-size: 13px; line-height: 1.6;&quot;&gt;先确认可执行文件架构，旧盘不能直接启动。&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;再看新机器：&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; background: rgb(31, 35, 40); color: rgb(230, 237, 243); padding: 16px 18px; border-radius: 10px; overflow-x: auto; margin: 16px 0px; line-height: 1.6; font-size: 15.5px;&quot;&gt;uname&amp;nbsp;-m
#&amp;nbsp;aarch64&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;到这儿，替换引导卷这条路就不用再想了。&lt;/p&gt;&lt;h2 style=&quot;box-sizing: border-box; font-size: 18px; margin: 30px 0px 12px; padding-left: 11px; border-left: 4px solid rgb(25, 135, 84); color: rgb(17, 17, 17); line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;为什么架构不同就没法用&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;x86 和 ARM 是两套不同的指令集。我们平时安装的软件，本质是源码编译成对应 CPU 能读懂的机器码。x86 编译出来的二进制，ARM 的 CPU 读不懂——不是兼容性问题，是两套语言。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;Linux 可执行文件是 ELF 格式，文件头里写明了它面向哪种架构，&lt;code style=&quot;box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; background: rgb(243, 244, 246); color: rgb(199, 37, 78); padding: 2px 6px; border-radius: 5px; font-size: 13.5px;&quot;&gt;file&lt;/code&gt; 读的就是这里。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;于是旧盘的定位很明确：&lt;/p&gt;&lt;ul style=&quot;box-sizing: border-box; padding-left: 24px; margin: 12px 0px; color: rgb(36, 41, 47); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong style=&quot;box-sizing: border-box; color: rgb(17, 17, 17);&quot;&gt;当数据盘读、拷贝内容&lt;/strong&gt;：可以。文件不挑架构，x86 盘里的文稿、图片、SQL、配置，ARM 机器一样能读；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong style=&quot;box-sizing: border-box; color: rgb(17, 17, 17);&quot;&gt;当系统盘启动、跑里面的程序&lt;/strong&gt;：不行。内核和第一个进程都是 x86 指令，机器根本起不来。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;box-sizing: border-box; font-size: 18px; margin: 30px 0px 12px; padding-left: 11px; border-left: 4px solid rgb(25, 135, 84); color: rgb(17, 17, 17); line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;那正确的迁移方式是什么&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;系统和软件在 ARM 上重新装，只搬数据。旧卷继续挂着当数据盘，我逐项搬这些与架构无关的东西：&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;box-sizing: border-box; margin: 26px auto 30px; max-width: 680px; text-align: center; color: rgb(36, 41, 47); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/blog/1791159158695_upload_20261005_081229_6491.png&quot; style=&quot;max-width:100%;height:auto;&quot; alt=&quot;&quot;/&gt;&lt;figcaption style=&quot;box-sizing: border-box; margin-top: 8px; color: rgb(107, 114, 128); font-size: 13px; line-height: 1.6;&quot;&gt;跨架构迁移：数据能搬，系统和二进制要重装。&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;&lt;/p&gt;&lt;ol style=&quot;box-sizing: border-box; padding-left: 24px; margin: 12px 0px; color: rgb(36, 41, 47); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;网站源码、用户上传的文件（PHP、图片、附件，脚本和数据不挑架构）；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;数据库用 &lt;code style=&quot;box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; background: rgb(243, 244, 246); color: rgb(199, 37, 78); padding: 2px 6px; border-radius: 5px; font-size: 13.5px;&quot;&gt;mysqldump&lt;/code&gt; 导出成 &lt;code style=&quot;box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; background: rgb(243, 244, 246); color: rgb(199, 37, 78); padding: 2px 6px; border-radius: 5px; font-size: 13.5px;&quot;&gt;.sql&lt;/code&gt; 再导入（这步坑不少，单独写了一篇）；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;SSL 证书、密钥（PEM 文本）；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Nginx 等配置文件（文本，复制后按新环境改路径）；&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;定时任务、部署的应用，在新系统重新配置。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;跟架构绑定的——操作系统、编译好的二进制、系统库——一律用 apt 或面板在 ARM 上重装。&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;figure class=&quot;article-illustration&quot; style=&quot;box-sizing: border-box; margin: 26px auto 30px; max-width: 680px; text-align: center; color: rgb(36, 41, 47); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&lt;img src=&quot;https://img.yjtv.top/file/blog/1791159223999_upload_20261005_081338_1462.png&quot; style=&quot;max-width:100%;height:auto;&quot; alt=&quot;&quot;/&gt;&lt;img src=&quot;https://yjtv.top/zb_users/plugin/UEditor/themes/default/images/spacer.gif&quot; alt=&quot;源码、导出文件和配置逐项搬到新系统。&quot; style=&quot;background:url(https://yjtv.top/zb_users/plugin/UEditor/lang/zh-cn/images/localimage.png) no-repeat center center;border:1px solid #ddd&quot; word_img=&quot;file:///C:/Users/Admin/Documents/Codex/2026-10-03/use-ian-xiaohei-illustrations-7-5/outputs/images/a1-data-only.png&quot;/&gt;&lt;figcaption style=&quot;box-sizing: border-box; margin-top: 8px; color: rgb(107, 114, 128); font-size: 13px; line-height: 1.6;&quot;&gt;源码、导出文件和配置逐项搬到新系统。&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;&lt;/p&gt;&lt;h2 style=&quot;box-sizing: border-box; font-size: 18px; margin: 30px 0px 12px; padding-left: 11px; border-left: 4px solid rgb(25, 135, 84); color: rgb(17, 17, 17); line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;几个云盘操作命令&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;整个过程反复在&amp;quot;附加 → 挂载 → 拷贝 → 卸载 → 分离&amp;quot;，通用命令如下（设备名先 &lt;code style=&quot;box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; background: rgb(243, 244, 246); color: rgb(199, 37, 78); padding: 2px 6px; border-radius: 5px; font-size: 13.5px;&quot;&gt;lsblk&lt;/code&gt; 确认）：&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; background: rgb(31, 35, 40); color: rgb(230, 237, 243); padding: 16px 18px; border-radius: 10px; overflow-x: auto; margin: 16px 0px; line-height: 1.6; font-size: 15.5px;&quot;&gt;#&amp;nbsp;确认新挂上来的盘（如&amp;nbsp;/dev/sdb）
lsblk

#&amp;nbsp;挂载分区（假设数据在第2个分区）
sudo&amp;nbsp;mount&amp;nbsp;/dev/sdb2&amp;nbsp;/mnt/oldroot

#&amp;nbsp;拷贝数据&amp;nbsp;...

#&amp;nbsp;用完卸载（先退出目录，确保没有进程占用）
sudo&amp;nbsp;umount&amp;nbsp;/mnt/oldroot&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;卸载后到控制台&amp;quot;分离（Detach）&amp;quot;。确认数据全部拷完、不再需要后，才&amp;quot;终止（Terminate）&amp;quot;——这步不可逆，务必先有备份。&lt;/p&gt;&lt;h2 style=&quot;box-sizing: border-box; font-size: 18px; margin: 30px 0px 12px; padding-left: 11px; border-left: 4px solid rgb(25, 135, 84); color: rgb(17, 17, 17); line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;写在最后&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;这次迁移给自己提了个醒：以后跨机器搬服务器，先跑一条 &lt;code style=&quot;box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; background: rgb(243, 244, 246); color: rgb(199, 37, 78); padding: 2px 6px; border-radius: 5px; font-size: 13.5px;&quot;&gt;uname -m&lt;/code&gt;。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;架构一致，克隆盘、做镜像都随意；架构不一致，就老老实实只搬数据，系统和软件重装。删旧卷前确认数据拷完、有备份，云盘终止找不回来。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin: 14px 0px; color: rgb(45, 51, 59); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, Arial, sans-serif; font-size: 15.5px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;数据库迁移、ARM 编译依赖、家宽端口这几个后续的坑，我也分别整理了，可以翻翻看。&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Sat, 03 Oct 2026 19:15:23 +0800</pubDate></item><item><title>阿宅二级域名分发系统 轻量化全开源</title><link>https://yjtv.top/?id=18</link><description>&lt;h2&gt;项目介绍&lt;/h2&gt;&lt;p&gt;AZhai Sub 是一个新一代的二级域名管理器，堪比 us.kg。&lt;strong&gt;无需 NS 服务器，只需要申请二级域名即可使用&lt;/strong&gt;。&lt;/p&gt;&lt;p&gt;例如你拥有 &lt;code&gt;xxx.com&lt;/code&gt;，用户申请 &lt;code&gt;you.xxx.com&lt;/code&gt;，那么 &lt;code&gt;*.you.xxx.com&lt;/code&gt; 下的域名都可以进行管理。&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://img.yjtv.top/file/blog/1790429152783_upload_20260926_212547_8914.png&quot; style=&quot;max-width: 100%; height: 511px; width: 753px;&quot; alt=&quot;&quot; width=&quot;753&quot; height=&quot;511&quot;/&gt;&lt;/p&gt;&lt;h2&gt;功能特性&lt;/h2&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;二级域名申请与管理、域名申请审核&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;自定义二级域名、域名启用 / 暂停 / 恢复&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;DNS 解析管理、DNS 记录自动同步&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;SSL 证书申请&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;在线系统更新&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;管理员后台：用户管理、域名管理、DNS 服务商管理、操作日志&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;阿宅 OAuth 登录、多 DNS 服务商支持&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;DNS 解析&lt;/h2&gt;&lt;p&gt;目前支持以下记录类型：&lt;strong&gt;A、AAAA、CNAME、TXT&lt;/strong&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;注意：TXT 根域名验证需要用户申请 TXT 验证，管理员审核通过后，再由管理员手动添加 TXT 记录。&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2&gt;DNS 服务商&lt;/h2&gt;&lt;p&gt;目前支持：&lt;strong&gt;Cloudflare、阿里云 DNS、华为云 DNS、腾讯云 DNS、西部数码 DNS&lt;/strong&gt;，后续会根据实际需求继续接入更多服务商。&lt;/p&gt;&lt;h2&gt;SSL 证书&lt;/h2&gt;&lt;p&gt;支持 SSL 证书申请功能，用户可以针对自己的二级域名申请 SSL 证书，让分配的二级域名更方便地使用 HTTPS。&lt;/p&gt;&lt;h2&gt;如何使用&lt;/h2&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;上传项目&lt;/strong&gt;：将项目上传到网站目录并解压&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;导入数据库&lt;/strong&gt;：创建数据库后，将项目中的 &lt;code&gt;database.sql&lt;/code&gt; 导入&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;修改配置&lt;/strong&gt;：编辑 &lt;code&gt;config.php&lt;/code&gt;，填写数据库连接信息；如需「阿宅登录」，可在此配置 OAuth 信息&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;登录后台&lt;/strong&gt;：后台地址 &lt;code&gt;https://你的域名/admin&lt;/code&gt;，默认管理员账号 &lt;code&gt;azhai / azhai123&lt;/code&gt;，首次登录后建议立即修改默认密码&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2&gt;阿宅登录&lt;/h2&gt;&lt;p&gt;支持接入「阿宅登录」：前往 &lt;code&gt;oauth.azhai.de&lt;/code&gt; 申请 OAuth 密钥，填入 &lt;code&gt;config.php&lt;/code&gt;。配置完成后注册一个阿宅账号，即可用同一账号登录所有接入阿宅 OAuth 的项目。&lt;/p&gt;&lt;h2&gt;在线升级&lt;/h2&gt;&lt;p&gt;内置在线升级功能，后续版本更新都可通过后台「系统更新」一键升级，无需重新下载、上传和覆盖文件。&lt;/p&gt;&lt;h2&gt;技术栈&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;PHP 8 + MySQL 8&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Sat, 26 Sep 2026 21:05:32 +0800</pubDate></item></channel></rss>