<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>feng的博客</title><link>https://blog.swihp.cn/</link><description></description><item><title>群晖 Synology NAS 在高校内验证登录</title><link>https://blog.swihp.cn/?id=1435</link><description>&lt;p data-v-2505e99a=&quot;&quot; style=&quot;white-space: pre-wrap; word-break: break-word; font-size: 17px; line-height: 29px; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(47, 50, 56); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span data-v-2505e99a=&quot;&quot;&gt;群晖 Synology NAS 连接至校园网或者一些企业单位后，校园或者企业需要登录个人帐号验证后才能联网，由于群晖本身没有web浏览器用于网页登录认证导致 NAS 无法联网更新套件、更新系统等操作。推荐几种方法大家可以尝试下：&lt;/span&gt;&lt;/p&gt;&lt;p data-v-2505e99a=&quot;&quot; style=&quot;white-space: pre-wrap; word-break: break-word; font-size: 17px; line-height: 29px; margin-top: 24px; margin-bottom: 0px; padding: 0px; color: rgb(47, 50, 56); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span data-v-2505e99a=&quot;&quot; style=&quot;font-weight: 600;&quot;&gt;1. &lt;/span&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;使用代理&lt;/span&gt;&lt;/p&gt;&lt;p data-v-2505e99a=&quot;&quot; style=&quot;margin-top: 24px; margin-bottom: 0px; white-space: pre-wrap; word-break: break-word; font-size: 17px; line-height: 29px; padding: 0px; color: rgb(47, 50, 56); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span data-v-2505e99a=&quot;&quot;&gt;首先去群晖官网 &lt;a href=&quot;https://www.synology.cn/zh-cn/support/download&quot; target=&quot;_blank&quot;&gt;下载&lt;/a&gt; 套件 &lt;/span&gt;&lt;a href=&quot;https://archive.synology.cn/download/Package/ProxyServer&quot; target=&quot;_blank&quot;&gt;&lt;span data-v-2505e99a=&quot;&quot; style=&quot;font-weight: 600;&quot;&gt;Proxy Server&lt;/span&gt;&lt;/a&gt;&lt;span data-v-2505e99a=&quot;&quot;&gt;，然后打开群晖套件中心，选择手动安装。&lt;/span&gt;&lt;/p&gt;&lt;p data-v-2505e99a=&quot;&quot; style=&quot;margin-top: 24px; margin-bottom: 0px; white-space: pre-wrap; word-break: break-word; font-size: 17px; line-height: 29px; padding: 0px; color: rgb(47, 50, 56); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span data-v-2505e99a=&quot;&quot;&gt;打开 Proxy Server 套件，做好配置，然后将个人电脑的代理服务器设置为 NAS IP 地址&lt;/span&gt;&lt;span data-v-2505e99a=&quot;&quot;&gt;。&lt;/span&gt;&lt;/p&gt;&lt;p data-v-2505e99a=&quot;&quot; style=&quot;margin-top: 24px; margin-bottom: 0px; white-space: pre-wrap; word-break: break-word; font-size: 17px; line-height: 29px; padding: 0px; color: rgb(47, 50, 56); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span data-v-2505e99a=&quot;&quot; style=&quot;font-weight: 600;&quot;&gt;代理ip为群晖的ip地址，端口为Proxy Server中设置的端口&lt;/span&gt;&lt;span data-v-2505e99a=&quot;&quot;&gt;。&lt;/span&gt;&lt;/p&gt;&lt;p data-v-2505e99a=&quot;&quot; style=&quot;margin-top: 24px; margin-bottom: 0px; white-space: pre-wrap; word-break: break-word; font-size: 17px; line-height: 29px; padding: 0px; color: rgb(47, 50, 56); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span data-v-2505e99a=&quot;&quot;&gt;设置好代理服务器后，打开个人电脑网页刷新出上网认证网页，登录成功即可。&lt;/span&gt;&lt;/p&gt;&lt;p data-v-2505e99a=&quot;&quot; style=&quot;margin-top: 24px; margin-bottom: 0px; white-space: pre-wrap; word-break: break-word; font-size: 17px; line-height: 29px; padding: 0px; color: rgb(47, 50, 56); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; background-color: rgb(255, 255, 255);&quot;&gt;&lt;b&gt;2. Container Manager 导入一个浏览器容器&lt;/b&gt;&lt;/p&gt;&lt;p data-v-2505e99a=&quot;&quot; style=&quot;margin-top: 24px; margin-bottom: 0px; white-space: pre-wrap; word-break: break-word; font-size: 17px; line-height: 29px; padding: 0px; color: rgb(47, 50, 56); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; background-color: rgb(255, 255, 255);&quot;&gt;首先在其他docker中安装一个浏览器容器，然后导出容器，再导入Container Manager中。&lt;/p&gt;&lt;p data-v-2505e99a=&quot;&quot; style=&quot;margin-top: 24px; margin-bottom: 0px; white-space: pre-wrap; word-break: break-word; font-size: 17px; line-height: 29px; padding: 0px; color: rgb(47, 50, 56); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; background-color: rgb(255, 255, 255);&quot;&gt;通过容器中的浏览器页面登录认证后一样可以解决群晖NAS 上网认证问题&lt;/p&gt;&lt;p data-v-2505e99a=&quot;&quot; style=&quot;margin-top: 24px; margin-bottom: 0px; white-space: pre-wrap; word-break: break-word; font-size: 17px; line-height: 29px; padding: 0px; color: rgb(47, 50, 56); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; background-color: rgb(255, 255, 255);&quot;&gt;&lt;strong&gt;3. 咨询校园或者企业网络认证中心，Linux 登录验证方法&lt;/strong&gt;&lt;/p&gt;&lt;p data-v-2505e99a=&quot;&quot; style=&quot;margin-top: 24px; margin-bottom: 0px; white-space: pre-wrap; word-break: break-word; font-size: 17px; line-height: 29px; padding: 0px; color: rgb(47, 50, 56); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; background-color: rgb(255, 255, 255);&quot;&gt;&lt;b&gt;例：&lt;a href=&quot;https://its.pku.edu.cn/download_ipgwclient.jsp&quot; target=&quot;_blank&quot;&gt;北京大学网络服务&lt;/a&gt; &lt;/b&gt;&lt;/p&gt;&lt;p data-v-2505e99a=&quot;&quot; style=&quot;white-space: pre-wrap; word-break: break-word; font-size: 17px; line-height: 29px; margin-top: 24px; margin-bottom: 0px; padding: 0px; color: rgb(47, 50, 56); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span data-v-2505e99a=&quot;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;box-sizing: inherit; border: 0px; padding: 0px; margin: 10px 0px; font-family: &amp;quot;Microsoft Yahei&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Tahoma, Arial, Helvetica, &amp;quot;sans-serif&amp;quot;; -webkit-font-smoothing: subpixel-antialiased; font-weight: 500; line-height: 1.1; color: rgb(51, 51, 51); font-size: 18px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;命令行【供参考】&lt;/span&gt;&lt;/h4&gt;&lt;div class=&quot;app-table&quot; style=&quot;box-sizing: inherit; border: 0px; padding: 0px; margin: 15px; font-family: &amp;quot;Microsoft Yahei&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Tahoma, Arial, Helvetica, &amp;quot;sans-serif&amp;quot;; -webkit-font-smoothing: subpixel-antialiased; line-height: 1.5; color: rgb(51, 51, 51); font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div style=&quot;box-sizing: inherit; border: 0px; padding: 0px; margin: 0px; -webkit-font-smoothing: subpixel-antialiased;&quot;&gt;由于网关登录方式调整，原网关命令行登录程序connect已经停止使用，新的命令行登录方式请参考下面的示例。&lt;/div&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Bash&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;code style=&quot;box-sizing: inherit; border: 0px; padding: 2px 4px; margin: 0px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; -webkit-font-smoothing: subpixel-antialiased; font-size: 14.4px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; white-space-collapse: preserve;&quot;&gt; &amp;nbsp;curl -X POST &amp;nbsp;-d &amp;#39;cmd=open&amp;amp;username=**********&amp;amp;password=******&amp;amp;iprange=free&amp;#39; https://its4.pku.edu.cn/cas/ITSClient&lt;/code&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Python&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;code style=&quot;box-sizing: inherit; border: 0px; padding: 2px 4px; margin: 0px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; -webkit-font-smoothing: subpixel-antialiased; font-size: 14.4px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; white-space-collapse: preserve;&quot;&gt; &amp;nbsp;import requests
 &amp;nbsp;url = &amp;quot;https://its4.pku.edu.cn/cas/ITSClient&amp;quot;
 &amp;nbsp;payload = {
 &amp;nbsp; &amp;nbsp; &amp;nbsp;# 填写账号和密码
 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#39;username&amp;#39;: &amp;#39;********&amp;#39;,
 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#39;password&amp;#39;: &amp;#39;********&amp;#39;,
 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#39;iprange&amp;#39;: &amp;#39;free&amp;#39;,
 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#39;cmd&amp;#39;: &amp;#39;open&amp;#39;
 &amp;nbsp;}
 &amp;nbsp;headers = {&amp;#39;Content-type&amp;#39;: &amp;#39;application/x-www-form-urlencoded&amp;#39;}
 &amp;nbsp;result = requests.post(url, params=payload, headers=headers)
 &amp;nbsp;print(result.text)&lt;/code&gt;&lt;/ul&gt;&lt;div style=&quot;box-sizing: inherit; border: 0px; padding: 0px; margin: 0px; -webkit-font-smoothing: subpixel-antialiased;&quot;&gt;请使用学号或者职工号替代username后面的星号，并填写您的密码password。&lt;br style=&quot;box-sizing: inherit;&quot;/&gt;如需断开链接，请将open改为disconnect。&lt;/div&gt;&lt;/div&gt;&lt;p data-v-2505e99a=&quot;&quot; style=&quot;white-space: pre-wrap; word-break: break-word; font-size: 17px; line-height: 29px; margin-top: 24px; margin-bottom: 0px; padding: 0px; color: rgb(47, 50, 56); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; background-color: rgb(255, 255, 255);&quot;&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 14 Oct 2025 14:14:33 +0800</pubDate></item><item><title>群晖Synology DSM安装常见问题</title><link>https://blog.swihp.cn/?id=1434</link><description>&lt;p&gt;安装时系统磁盘空间不足&lt;/p&gt;&lt;p&gt;可以浏览器输入 http://&amp;lt;ip&amp;gt;:5000/webman/clean_system_disk.cgi 尝试&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 30 Sep 2025 11:15:03 +0800</pubDate></item><item><title>群晖SynologyNAS DSM通过 acme.sh 实现域名证书自动更新</title><link>https://blog.swihp.cn/?id=1433</link><description>&lt;p&gt;注意事项：&lt;/p&gt;&lt;p&gt;①尽量使使用root帐号去操作，管理员帐号可能会出现各种报错。&lt;/p&gt;&lt;p&gt;②群晖默认证书保存目录：&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;/usr/syno/etc/certificate/_archive/$(cat /usr/syno/etc/certificate/_archive/DEFAULT)&lt;/p&gt;&lt;p&gt;默认情况下群晖的默认证书是官方的证书，acme导入证书前一定先手动导入一次证书。&lt;/p&gt;&lt;p&gt;③阿里与腾讯及其他域名供应商的 dns api 参数不一样，具体可参考 Acme.sh 官方文档 中的「DNS API」列表。&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/acmesh-official/acme.sh/wiki/dnsapi&quot; _src=&quot;https://github.com/acmesh-official/acme.sh/wiki/dnsapi&quot;&gt;https://github.com/acmesh-official/acme.sh/wiki/dnsapi&lt;/a&gt;&lt;/p&gt;&lt;p&gt;④准备申请证书的域名一定先去&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://ram.console.aliyun.com/profile/access-keys&quot; target=&quot;_blank&quot; title=&quot;阿里云&quot; style=&quot;text-wrap-mode: wrap;&quot;&gt;阿里云&lt;/a&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;、&lt;/span&gt;&lt;a href=&quot;https://console.dnspod.cn/account/token/token&quot; target=&quot;_blank&quot; style=&quot;text-wrap-mode: wrap;&quot;&gt;腾讯云(DNSPod)&lt;/a&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;&amp;nbsp;看下有没有解析记录，新申请的域名或者从没有使用的二级域名会申请失败。&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&lt;h2&gt;一、准备工作&lt;/h2&gt;&lt;p&gt;登录&amp;nbsp;&lt;a href=&quot;https://ram.console.aliyun.com/profile/access-keys&quot; target=&quot;_blank&quot; title=&quot;阿里云&quot;&gt;阿里云&lt;/a&gt;、&lt;a href=&quot;https://console.dnspod.cn/account/token/token&quot; target=&quot;_blank&quot;&gt;腾讯云(DNSPod)&lt;/a&gt; 创建并获取API密钥保存下来。&lt;/p&gt;&lt;h2&gt;二、使用ssh登录群晖&lt;/h2&gt;&lt;p&gt;1.下载acme.sh&lt;/p&gt;&lt;p&gt;acme.sh 是一个用于自动化获取和管理 Let’s Encrypt 证书的脚本。&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;curl&amp;nbsp;https://get.acme.sh&amp;nbsp;|&amp;nbsp;sh&amp;nbsp;-s&amp;nbsp;email=1396053199@qq.com&amp;nbsp;--force
或
wget&amp;nbsp;-O&amp;nbsp;-&amp;nbsp;&amp;nbsp;https://get.acme.sh&amp;nbsp;|&amp;nbsp;sh&amp;nbsp;-s&amp;nbsp;email=1396053199@qq.com&amp;nbsp;--force&lt;/pre&gt;&lt;p&gt;将 1396053199@qq.com 替换为自己的有效电子邮件地址，用于接收 Let’s Encrypt 的重要通知，如证书即将过期等信息。&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;安装过程会有报错，群晖系统默认没有&lt;/span&gt;安装或没有权限启用&amp;nbsp;cron&amp;nbsp;服务（定时任务工具），而 Acme.sh 依赖&amp;nbsp;cron&amp;nbsp;实现证书自动续签。&lt;/p&gt;&lt;p&gt;可以忽略这个报错，最后出现 Install success 就可以。acme.sh 会自动添加到系统环境变量中。&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/cert001.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;如果成功安装，脚本会将 acme.sh 下载到当前用户目录下，也就是 ~/.acme.sh 目录。&lt;/p&gt;&lt;p&gt;通过 cd ~/.acme.sh 或 cd /var/services/homes/当前登录的用户名/.acme.sh 进入目录&lt;/p&gt;&lt;p&gt;使用命令验证 acme.sh 是否安装成功：&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;cd&amp;nbsp;~/.acme.sh&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#或&amp;nbsp;cd&amp;nbsp;/var/services/homes/sunfeng/.acme.sh&amp;nbsp;“sunfeng”为我当前登录的用户名
./acme.sh&amp;nbsp;--version&lt;/pre&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/cert002.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;2. 添加API密钥至/etc/profile&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;#阿里云&amp;nbsp;API&amp;nbsp;密钥添加到环境变量
echo&amp;nbsp;&amp;quot;export&amp;nbsp;Ali_Key=&amp;quot;AccessKey&amp;nbsp;ID&amp;quot;&amp;quot;&amp;nbsp;&amp;gt;&amp;gt;&amp;nbsp;/etc/profile
echo&amp;nbsp;&amp;quot;export&amp;nbsp;Ali_Secret=&amp;quot;AccessKey&amp;nbsp;Secret&amp;quot;&amp;quot;&amp;nbsp;&amp;gt;&amp;gt;&amp;nbsp;/etc/profile&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;source&amp;nbsp;/etc/profile

#&amp;nbsp;腾讯云&amp;nbsp;DNSPod&amp;nbsp;的&amp;nbsp;API&amp;nbsp;密钥添加到环境变量
echo&amp;nbsp;&amp;quot;export&amp;nbsp;DP_Id=&amp;quot;AccessKey&amp;nbsp;ID&amp;quot;&amp;quot;&amp;nbsp;&amp;gt;&amp;gt;&amp;nbsp;/etc/profile
echo&amp;nbsp;&amp;quot;export&amp;nbsp;DP_Key=&amp;quot;AccessKey&amp;nbsp;Token&amp;quot;&amp;quot;&amp;nbsp;&amp;gt;&amp;gt;&amp;nbsp;/etc/profile&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;source&amp;nbsp;/etc/profile&lt;/pre&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;#&amp;nbsp;删除包含&amp;quot;export&amp;nbsp;DP_Id=&amp;quot;的行
sudo&amp;nbsp;sed&amp;nbsp;-i&amp;nbsp;&amp;#39;/export&amp;nbsp;DP_Id=/d&amp;#39;&amp;nbsp;/etc/profile

#&amp;nbsp;删除包含&amp;quot;export&amp;nbsp;DP_Key=&amp;quot;的行
sudo&amp;nbsp;sed&amp;nbsp;-i&amp;nbsp;&amp;#39;/export&amp;nbsp;DP_Key=/d&amp;#39;&amp;nbsp;/etc/profile&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;3.申请证书，填写的域名一定是阿里、腾讯或其他域名供应商的管理页面上有过解析记录&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;./acme.sh&amp;nbsp;--issue&amp;nbsp;--dns&amp;nbsp;dns_ali&amp;nbsp;-d&amp;nbsp;example.com&amp;nbsp;-d&amp;nbsp;*.example.com

./acme.sh&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;&amp;nbsp;#&amp;nbsp;使用&amp;nbsp;acme.sh&amp;nbsp;脚本执行证书申请操作
&amp;nbsp;&amp;nbsp;--issue&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;&amp;nbsp;#&amp;nbsp;核心参数：表示证书申请流程
&amp;nbsp;&amp;nbsp;--dns&amp;nbsp;dns_ali&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;DNS&amp;nbsp;验证方式，这里使用阿里云（Aliyun）的&amp;nbsp;DNS&amp;nbsp;解析接口
&amp;nbsp;&amp;nbsp;-d&amp;nbsp;example.com&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;example.com&amp;nbsp;申请证书
&amp;nbsp;&amp;nbsp;-d&amp;nbsp;*.example.com&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;同时为该域名的所有子域名（通配符）申请证书&lt;/pre&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/cert003.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;证书申请成功后会保存在 ~/.acme.sh （/root/.acme.sh/） 目录下&lt;/p&gt;&lt;p&gt;4、查看已安装证书信息：&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;acme.sh&amp;nbsp;--info&amp;nbsp;-d&amp;nbsp;example.com&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;example.com&amp;nbsp;改为自己的域名&lt;/pre&gt;&lt;h2&gt;三、替换群晖NAS的默认证书&lt;/h2&gt;&lt;p style=&quot;text-wrap-mode: wrap;&quot;&gt;新申请的证书保存名录：&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;#&amp;nbsp;ls&amp;nbsp;/root/.acme.sh/&amp;nbsp;可以看到多了一个example.com&amp;nbsp;或者&amp;nbsp;example.com_ecc的目录&amp;nbsp;此目录下就是新申请的证书
/root/.acme.sh/example.com_ecc/&lt;/pre&gt;&lt;p style=&quot;text-wrap-mode: wrap;&quot;&gt;群晖默认证书保存目录：&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;/usr/syno/etc/certificate/_archive/$(cat&amp;nbsp;/usr/syno/etc/certificate/_archive/DEFAULT)&lt;/pre&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;sudo&amp;nbsp;cp&amp;nbsp;-f&amp;nbsp;&amp;quot;/root/.acme.sh/example.com_ecc/fullchain.cer&amp;quot;&amp;nbsp;&amp;quot;/usr/syno/etc/certificate/_archive/$(cat&amp;nbsp;/usr/syno/etc/certificate/_archive/DEFAULT)/cert.pem&amp;quot;
sudo&amp;nbsp;cp&amp;nbsp;-f&amp;nbsp;&amp;quot;/root/.acme.sh/example.com_ecc/hkcnas.com.key&amp;quot;&amp;nbsp;&amp;quot;/usr/syno/etc/certificate/_archive/$(cat&amp;nbsp;/usr/syno/etc/certificate/_archive/DEFAULT)/privkey.pem&amp;quot;
sudo&amp;nbsp;cp&amp;nbsp;-f&amp;nbsp;&amp;quot;/root/.acme.sh/example.com_ecc/ca.cer&amp;quot;&amp;nbsp;&amp;quot;/usr/syno/etc/certificate/_archive/$(cat&amp;nbsp;/usr/syno/etc/certificate/_archive/DEFAULT)/chain.pem&amp;quot;&lt;/pre&gt;&lt;ol class=&quot;auto-hide-last-sibling-br list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); outline: none; border: 0px solid; margin: 0px; padding: 0px; line-height: 28px; overflow-anchor: auto;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; outline: none; border: 0px solid; margin: 0px; padding: 0px; font-weight: 600; line-height: 28px; overflow-anchor: auto; color: #000000 !important;&quot;&gt;路径格式&lt;/span&gt;：&lt;/div&gt;&lt;/li&gt;&lt;ul class=&quot;auto-hide-last-sibling-br list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;源路径&amp;nbsp;&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); outline: none; border: 0px solid; margin: 0px; padding: 0px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-size: 14px; font-variation-settings: normal; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.06); border-radius: 4px; color: rgb(0, 0, 0); overflow-anchor: auto;&quot;&gt;/root/.acme.sh/hkcnas.com_ecc/&lt;/code&gt;&amp;nbsp;是 ECC 证书的正确存放目录。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;目标路径使用了&amp;nbsp;&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); outline: none; border: 0px solid; margin: 0px; padding: 0px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-size: 14px; font-variation-settings: normal; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.06); border-radius: 4px; color: rgb(0, 0, 0); overflow-anchor: auto;&quot;&gt;$(cat /usr/syno/etc/certificate/_archive/DEFAULT)&lt;/code&gt;&amp;nbsp;动态获取群晖默认证书的 ID 目录，能自动定位当前正在使用的证书目录，无需手动填写 ID。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); outline: none; border: 0px solid; margin: 0px; padding: 0px; line-height: 28px; overflow-anchor: auto;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; outline: none; border: 0px solid; margin: 0px; padding: 0px; font-weight: 600; line-height: 28px; overflow-anchor: auto; color: #000000 !important;&quot;&gt;文件名映射&lt;/span&gt;：&lt;/div&gt;&lt;/li&gt;&lt;ul class=&quot;auto-hide-last-sibling-br list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); outline: none; border: 0px solid; margin: 0px; padding: 0px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-size: 14px; font-variation-settings: normal; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.06); border-radius: 4px; color: rgb(0, 0, 0); overflow-anchor: auto;&quot;&gt;fullchain.cer&lt;/code&gt;&amp;nbsp;→&amp;nbsp;&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); outline: none; border: 0px solid; margin: 0px; padding: 0px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-size: 14px; font-variation-settings: normal; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.06); border-radius: 4px; color: rgb(0, 0, 0); overflow-anchor: auto;&quot;&gt;cert.pem&lt;/code&gt;（群晖要求的证书文件名）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); outline: none; border: 0px solid; margin: 0px; padding: 0px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-size: 14px; font-variation-settings: normal; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.06); border-radius: 4px; color: rgb(0, 0, 0); overflow-anchor: auto;&quot;&gt;hkcnas.com.key&lt;/code&gt;&amp;nbsp;→&amp;nbsp;&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); outline: none; border: 0px solid; margin: 0px; padding: 0px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-size: 14px; font-variation-settings: normal; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.06); border-radius: 4px; color: rgb(0, 0, 0); overflow-anchor: auto;&quot;&gt;privkey.pem&lt;/code&gt;（群晖要求的私钥文件名）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); outline: none; border: 0px solid; margin: 0px; padding: 0px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-size: 14px; font-variation-settings: normal; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.06); border-radius: 4px; color: rgb(0, 0, 0); overflow-anchor: auto;&quot;&gt;ca.cer&lt;/code&gt;&amp;nbsp;→&amp;nbsp;&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); outline: none; border: 0px solid; margin: 0px; padding: 0px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-size: 14px; font-variation-settings: normal; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.06); border-radius: 4px; color: rgb(0, 0, 0); overflow-anchor: auto;&quot;&gt;chain.pem&lt;/code&gt;（群晖要求的中间证书文件名）&lt;br class=&quot;container-utlnW2 wrapper-d0Cc1k undefined&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); outline: none; border: 0px solid; margin: 0px; padding: 0px; overflow-anchor: auto;&quot;/&gt;文件名映射完全符合群晖系统对证书文件的命名规范，确保服务能正确识别。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;div class=&quot;auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); outline: none; border: 0px solid; margin: 0px; padding: 0px; line-height: 28px; overflow-anchor: auto;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: ; outline: none; border: 0px solid; margin: 0px; padding: 0px; font-weight: 600; line-height: 28px; overflow-anchor: auto; color: #000000 !important;&quot;&gt;参数&amp;nbsp;&lt;code style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); outline: none; border: 0px solid; margin: 0px; padding: 0px; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-feature-settings: normal; font-size: 14px; font-variation-settings: normal; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.06); border-radius: 4px; overflow-anchor: auto;&quot;&gt;-f&lt;/code&gt;&lt;/span&gt;：&lt;br class=&quot;container-utlnW2 wrapper-d0Cc1k undefined&quot; style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); outline: none; border: 0px solid; margin: 1em; padding: 0px; font-size: 20px; overflow-anchor: auto; content: &amp;quot;&amp;quot;; display: block;&quot;/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;强制覆盖目标文件（如果已存在），避免因文件已存在而复制失败，适合证书更新场景。&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;然后重启 Nginx 即可看到证书已更新&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;nginx&amp;nbsp;-s&amp;nbsp;reload&lt;/pre&gt;&lt;h2&gt;四、设置自动更新&lt;br/&gt;&lt;/h2&gt;&lt;p&gt;acme 申请证书每 60 天自动更新，默认情况下你无需任何操作，但是最开始下载安装 acme 时&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;&amp;nbsp;cron&amp;nbsp;服务报错，不确定是否可以自动更新。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;acme&lt;/span&gt;可以强制续签证书：&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;acme.sh&amp;nbsp;--renew&amp;nbsp;-d&amp;nbsp;example.com&amp;nbsp;--force&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;example.com&amp;nbsp;改为自己的域名&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;！！！修改下面脚本中的&amp;nbsp;DOMAIN=&amp;quot;example.com&amp;quot; 与&amp;nbsp;DNS_MODE=&amp;quot;dns_ali&amp;quot;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;未检测到证书：强制执行续签&lt;/p&gt;&lt;p&gt;证书已过期（剩余 0 天）：强制执行续签&lt;/p&gt;&lt;p&gt;证书剩余有效期≤10 天：&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;强制&lt;/span&gt;执行续签&lt;/p&gt;&lt;p&gt;证书剩余有效期 &amp;gt; 10 天：不执行任何操作（无论是否超过 20 天）&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;#!/bin/bash
set&amp;nbsp;-e&amp;nbsp;&amp;nbsp;#&amp;nbsp;遇到错误立即退出

#&amp;nbsp;====================&amp;nbsp;配置参数&amp;nbsp;====================
DOMAIN=&amp;quot;example.com&amp;quot;&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;&amp;nbsp;&amp;nbsp;#&amp;nbsp;你的域名
ACME_CERT_PATH=&amp;quot;/root/.acme.sh&amp;quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;acme.sh证书存放路径
SYNO_CERT_ARCHIVE=&amp;quot;/usr/syno/etc/certificate/_archive&amp;quot;&amp;nbsp;&amp;nbsp;#&amp;nbsp;群晖证书存档目录
DNS_MODE=&amp;quot;dns_ali&amp;quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;DNS验证方式（根据你的服务商修改&amp;nbsp;https://github.com/acmesh-official/acme.sh/wiki/dnsapi）
CERT_TYPE=&amp;quot;ecc&amp;quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;证书类型（ecc/rsa，留空自动适配）
RENEW_THRESHOLD=10&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;少于此天数时强制续签（天）
#&amp;nbsp;=================================================

#&amp;nbsp;函数：显示信息
info()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;-e&amp;nbsp;&amp;quot;\033[1;34m===&amp;nbsp;$1&amp;nbsp;===\033[0m&amp;quot;
}

#&amp;nbsp;函数：显示成功信息
success()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;-e&amp;nbsp;&amp;quot;\033[1;32m===&amp;nbsp;$1&amp;nbsp;===\033[0m&amp;quot;
}

#&amp;nbsp;函数：显示错误信息
error()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;-e&amp;nbsp;&amp;quot;\033[1;31m===&amp;nbsp;错误：$1&amp;nbsp;===\033[0m&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;exit&amp;nbsp;1
}

#&amp;nbsp;函数：检查证书剩余有效期（天）
check_cert_validity()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;local&amp;nbsp;cert_file=$1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;[&amp;nbsp;!&amp;nbsp;-f&amp;nbsp;&amp;quot;$cert_file&amp;quot;&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;获取证书过期时间（Unix时间戳）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;local&amp;nbsp;end_date=$(openssl&amp;nbsp;x509&amp;nbsp;-in&amp;nbsp;&amp;quot;$cert_file&amp;quot;&amp;nbsp;-noout&amp;nbsp;-enddate&amp;nbsp;|&amp;nbsp;cut&amp;nbsp;-d=&amp;nbsp;-f2)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;local&amp;nbsp;end_timestamp=$(date&amp;nbsp;-d&amp;nbsp;&amp;quot;$end_date&amp;quot;&amp;nbsp;+%s&amp;nbsp;2&amp;gt;/dev/null&amp;nbsp;||&amp;nbsp;true)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;local&amp;nbsp;current_timestamp=$(date&amp;nbsp;+%s)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;[&amp;nbsp;-z&amp;nbsp;&amp;quot;$end_timestamp&amp;quot;&amp;nbsp;]&amp;nbsp;||&amp;nbsp;[&amp;nbsp;&amp;quot;$end_timestamp&amp;quot;&amp;nbsp;-le&amp;nbsp;&amp;quot;$current_timestamp&amp;quot;&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;0&amp;nbsp;&amp;nbsp;#&amp;nbsp;证书已过期
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;计算剩余天数
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;local&amp;nbsp;diff_seconds=$((end_timestamp&amp;nbsp;-&amp;nbsp;current_timestamp))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;local&amp;nbsp;diff_days=$((diff_seconds&amp;nbsp;/&amp;nbsp;86400))&amp;nbsp;&amp;nbsp;#&amp;nbsp;86400秒=1天
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;$diff_days
}

#&amp;nbsp;1.&amp;nbsp;检查证书是否已存在（支持RSA和ECC）
info&amp;nbsp;&amp;quot;检查证书是否已存在&amp;quot;
CERT_DIR_RSA=&amp;quot;$ACME_CERT_PATH/$DOMAIN&amp;quot;
CERT_DIR_ECC=&amp;quot;$ACME_CERT_PATH/${DOMAIN}_ecc&amp;quot;
CERT_EXISTS=0
CURRENT_CERT_DIR=&amp;quot;&amp;quot;
CERT_FILE=&amp;quot;&amp;quot;

#&amp;nbsp;优先检查配置的证书类型
if&amp;nbsp;[&amp;nbsp;&amp;quot;$CERT_TYPE&amp;quot;&amp;nbsp;=&amp;nbsp;&amp;quot;ecc&amp;quot;&amp;nbsp;]&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;[&amp;nbsp;-d&amp;nbsp;&amp;quot;$CERT_DIR_ECC&amp;quot;&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CURRENT_CERT_DIR=&amp;quot;$CERT_DIR_ECC&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CERT_FILE=&amp;quot;$CURRENT_CERT_DIR/fullchain.cer&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CERT_EXISTS=1
elif&amp;nbsp;[&amp;nbsp;&amp;quot;$CERT_TYPE&amp;quot;&amp;nbsp;=&amp;nbsp;&amp;quot;rsa&amp;quot;&amp;nbsp;]&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;[&amp;nbsp;-d&amp;nbsp;&amp;quot;$CERT_DIR_RSA&amp;quot;&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CURRENT_CERT_DIR=&amp;quot;$CERT_DIR_RSA&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CERT_FILE=&amp;quot;$CURRENT_CERT_DIR/fullchain.cer&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CERT_EXISTS=1
#&amp;nbsp;未指定类型时自动检测
elif&amp;nbsp;[&amp;nbsp;-z&amp;nbsp;&amp;quot;$CERT_TYPE&amp;quot;&amp;nbsp;]&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;[&amp;nbsp;-d&amp;nbsp;&amp;quot;$CERT_DIR_ECC&amp;quot;&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CURRENT_CERT_DIR=&amp;quot;$CERT_DIR_ECC&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CERT_FILE=&amp;quot;$CURRENT_CERT_DIR/fullchain.cer&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CERT_TYPE=&amp;quot;ecc&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CERT_EXISTS=1
elif&amp;nbsp;[&amp;nbsp;-z&amp;nbsp;&amp;quot;$CERT_TYPE&amp;quot;&amp;nbsp;]&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;[&amp;nbsp;-d&amp;nbsp;&amp;quot;$CERT_DIR_RSA&amp;quot;&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CURRENT_CERT_DIR=&amp;quot;$CERT_DIR_RSA&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CERT_FILE=&amp;quot;$CURRENT_CERT_DIR/fullchain.cer&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CERT_TYPE=&amp;quot;rsa&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CERT_EXISTS=1
fi

if&amp;nbsp;[&amp;nbsp;$CERT_EXISTS&amp;nbsp;-eq&amp;nbsp;1&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&amp;quot;发现已存在的$CERT_TYPE证书：$CURRENT_CERT_DIR&amp;quot;
&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;info&amp;nbsp;&amp;quot;检查证书剩余有效期&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;REMAIN_DAYS=$(check_cert_validity&amp;nbsp;&amp;quot;$CERT_FILE&amp;quot;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&amp;quot;证书剩余有效期：$REMAIN_DAYS&amp;nbsp;天&amp;quot;
&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;if&amp;nbsp;[&amp;nbsp;$REMAIN_DAYS&amp;nbsp;-eq&amp;nbsp;0&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&amp;quot;证书已过期，将强制执行续签&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif&amp;nbsp;[&amp;nbsp;$REMAIN_DAYS&amp;nbsp;-le&amp;nbsp;$RENEW_THRESHOLD&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&amp;quot;证书剩余有效期不足$RENEW_THRESHOLD天，将执行续签&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;success&amp;nbsp;&amp;quot;证书有效期充足（剩余$REMAIN_DAYS天），无需更新&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;exit&amp;nbsp;0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi
else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&amp;quot;未发现已存在的证书，将执行新申请&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;未指定类型时默认使用ECC
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;[&amp;nbsp;-z&amp;nbsp;&amp;quot;$CERT_TYPE&amp;quot;&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CERT_TYPE=&amp;quot;ecc&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&amp;quot;默认使用ECC证书类型&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi
fi

#&amp;nbsp;2.&amp;nbsp;生成证书命令参数
info&amp;nbsp;&amp;quot;准备证书更新/申请命令&amp;quot;
ACME_CMD_BASE=&amp;quot;$ACME_CERT_PATH/acme.sh&amp;quot;
DOMAIN_PARAMS=&amp;quot;-d&amp;nbsp;$DOMAIN&amp;nbsp;-d&amp;nbsp;*.${DOMAIN}&amp;quot;
FORCE_PARAM=&amp;quot;--force&amp;quot;
DNS_PARAM=&amp;quot;--dns&amp;nbsp;$DNS_MODE&amp;quot;
CERT_TYPE_PARAM=&amp;quot;&amp;quot;
if&amp;nbsp;[&amp;nbsp;&amp;quot;$CERT_TYPE&amp;quot;&amp;nbsp;=&amp;nbsp;&amp;quot;ecc&amp;quot;&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CERT_TYPE_PARAM=&amp;quot;--ecc&amp;quot;
fi

#&amp;nbsp;3.&amp;nbsp;执行更新或申请
info&amp;nbsp;&amp;quot;执行证书操作（$([&amp;nbsp;$CERT_EXISTS&amp;nbsp;-eq&amp;nbsp;1&amp;nbsp;]&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;echo&amp;nbsp;&amp;quot;续签&amp;quot;&amp;nbsp;||&amp;nbsp;echo&amp;nbsp;&amp;quot;新申请&amp;quot;)）&amp;quot;
if&amp;nbsp;[&amp;nbsp;$CERT_EXISTS&amp;nbsp;-eq&amp;nbsp;1&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;证书已存在，执行续签
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;!&amp;nbsp;$ACME_CMD_BASE&amp;nbsp;--renew&amp;nbsp;$DOMAIN_PARAMS&amp;nbsp;$FORCE_PARAM&amp;nbsp;$DNS_PARAM&amp;nbsp;$CERT_TYPE_PARAM;&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;error&amp;nbsp;&amp;quot;证书续签失败，请检查acme.sh配置和网络&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi
else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;证书不存在，执行新申请
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;!&amp;nbsp;$ACME_CMD_BASE&amp;nbsp;--issue&amp;nbsp;$DOMAIN_PARAMS&amp;nbsp;$FORCE_PARAM&amp;nbsp;$DNS_PARAM&amp;nbsp;$CERT_TYPE_PARAM;&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;error&amp;nbsp;&amp;quot;证书申请失败，请检查acme.sh配置和网络&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;申请后更新证书目录变量
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;[&amp;nbsp;&amp;quot;$CERT_TYPE&amp;quot;&amp;nbsp;=&amp;nbsp;&amp;quot;ecc&amp;quot;&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CURRENT_CERT_DIR=&amp;quot;$CERT_DIR_ECC&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CURRENT_CERT_DIR=&amp;quot;$CERT_DIR_RSA&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CERT_FILE=&amp;quot;$CURRENT_CERT_DIR/fullchain.cer&amp;quot;
fi

#&amp;nbsp;4.&amp;nbsp;验证证书文件是否存在
info&amp;nbsp;&amp;quot;验证证书文件完整性&amp;quot;
REQUIRED_FILES=(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;$CURRENT_CERT_DIR/fullchain.cer&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;$CURRENT_CERT_DIR/$DOMAIN.key&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;$CURRENT_CERT_DIR/ca.cer&amp;quot;
)

for&amp;nbsp;file&amp;nbsp;in&amp;nbsp;&amp;quot;${REQUIRED_FILES[@]}&amp;quot;;&amp;nbsp;do
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;[&amp;nbsp;!&amp;nbsp;-f&amp;nbsp;&amp;quot;$file&amp;quot;&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;error&amp;nbsp;&amp;quot;缺少必要的证书文件：$file&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi
done

#&amp;nbsp;5.&amp;nbsp;复制证书到群晖默认目录并替换
info&amp;nbsp;&amp;quot;复制证书到群晖系统目录&amp;quot;
#&amp;nbsp;获取群晖当前默认证书ID
CERT_ID=$(cat&amp;nbsp;&amp;quot;$SYNO_CERT_ARCHIVE/DEFAULT&amp;quot;&amp;nbsp;2&amp;gt;/dev/null&amp;nbsp;||&amp;nbsp;true)
if&amp;nbsp;[&amp;nbsp;-z&amp;nbsp;&amp;quot;$CERT_ID&amp;quot;&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;error&amp;nbsp;&amp;quot;无法获取群晖默认证书ID，请检查证书目录&amp;quot;
fi

DEST_DIR=&amp;quot;$SYNO_CERT_ARCHIVE/$CERT_ID&amp;quot;
if&amp;nbsp;[&amp;nbsp;!&amp;nbsp;-d&amp;nbsp;&amp;quot;$DEST_DIR&amp;quot;&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;error&amp;nbsp;&amp;quot;群晖证书目标目录不存在：$DEST_DIR&amp;quot;
fi

#&amp;nbsp;强制复制并覆盖
echo&amp;nbsp;&amp;quot;复制证书到目标目录：$DEST_DIR&amp;quot;
cp&amp;nbsp;-f&amp;nbsp;&amp;quot;$CURRENT_CERT_DIR/fullchain.cer&amp;quot;&amp;nbsp;&amp;quot;$DEST_DIR/cert.pem&amp;quot;&amp;nbsp;||&amp;nbsp;error&amp;nbsp;&amp;quot;复制证书文件失败&amp;quot;
cp&amp;nbsp;-f&amp;nbsp;&amp;quot;$CURRENT_CERT_DIR/$DOMAIN.key&amp;quot;&amp;nbsp;&amp;quot;$DEST_DIR/privkey.pem&amp;quot;&amp;nbsp;||&amp;nbsp;error&amp;nbsp;&amp;quot;复制私钥文件失败&amp;quot;
cp&amp;nbsp;-f&amp;nbsp;&amp;quot;$CURRENT_CERT_DIR/ca.cer&amp;quot;&amp;nbsp;&amp;quot;$DEST_DIR/chain.pem&amp;quot;&amp;nbsp;||&amp;nbsp;error&amp;nbsp;&amp;quot;复制CA证书失败&amp;quot;

#&amp;nbsp;6.&amp;nbsp;重启相关服务确保生效
info&amp;nbsp;&amp;quot;重启服务使证书生效&amp;quot;
if&amp;nbsp;!&amp;nbsp;nginx&amp;nbsp;-s&amp;nbsp;reload;&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;error&amp;nbsp;&amp;quot;Nginx重启失败，请手动检查&amp;quot;
fi


success&amp;nbsp;&amp;quot;所有操作完成！证书已$(&amp;nbsp;[&amp;nbsp;$CERT_EXISTS&amp;nbsp;-eq&amp;nbsp;1&amp;nbsp;]&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;echo&amp;nbsp;&amp;quot;更新&amp;quot;&amp;nbsp;||&amp;nbsp;echo&amp;nbsp;&amp;quot;安装&amp;quot;&amp;nbsp;)并生效&amp;quot;&lt;/pre&gt;&lt;p&gt;复制上面的代码并修改 “&lt;strong style=&quot;text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;example.com&lt;/span&gt;&lt;/strong&gt;”“&lt;strong style=&quot;text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;dns_ali&lt;/span&gt;&lt;/strong&gt;”另存为 “update_synology_cert.sh”（文件名可以随便定义）&lt;/p&gt;&lt;p&gt;或者直接&amp;nbsp;&lt;a href=&quot;https://nas.swihp.cn:39997/file/file/update_synology_cert.sh&quot; target=&quot;_blank&quot;&gt;下载&lt;/a&gt;&amp;nbsp;我的脚本修改&amp;nbsp;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;“&lt;/span&gt;&lt;strong style=&quot;text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;example.com&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;”“&lt;/span&gt;&lt;strong style=&quot;text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;dns_ali&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;”&lt;a href=&quot;https://nas.swihp.cn:39997/file/file/update_synology_cert.sh&quot; target=&quot;_blank&quot; title=&quot;update_synology_cert.sh&quot;&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;update_synology_cert.sh&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;然后上传至群晖个人home目录下（目录自己随意选择），记住并复制“位置”信息。&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/cert004.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;打开计划任务：控制面板→计划任务→新增→用户自定义的脚本&lt;/p&gt;&lt;p&gt;用户帐号一定选择 “root”，&lt;/p&gt;&lt;p&gt;然后任务设置→用户自定义的脚本输入：&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;cd&amp;nbsp;/volume1/homes/sunfeng/
chmod&amp;nbsp;+x&amp;nbsp;update_synology_cert.sh
./update_synology_cert.sh&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/%E8%AE%A1%E5%88%92%E4%BB%BB%E5%8A%A1002.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;保存计划任务即可，以后就不用操心证书更新问题了&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 13 Aug 2025 12:43:55 +0800</pubDate></item><item><title>群晖docker安装dreamacro/clash + haishanh/yacd面板</title><link>https://blog.swihp.cn/?id=1432</link><description>&lt;p&gt;1、下载docker镜像&amp;nbsp;&lt;a href=&quot;https://nas.swihp.cn:39997/file/file/dreamacro-clash.tar&quot; target=&quot;_blank&quot;&gt;dreamacro/clash&lt;/a&gt; 、 &lt;a href=&quot;https://nas.swihp.cn:39997/file/file/haishanh-yacd.tar&quot; target=&quot;_blank&quot;&gt;haishanh/yacd&lt;/a&gt;&amp;nbsp; 并导入NAS，如果你的NAS能访问docker 请忽略此步。&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/dockerupload.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;2、准备 clash 配置文件并修改配置（没有 clash 配置文件请止步直接放弃，后边的内容不适合您）&lt;/p&gt;&lt;p&gt;打开配置文件 查找并修改&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;external-controller:&amp;nbsp;&amp;#39;0.0.0.0:9090&amp;#39;
allow-lan:&amp;nbsp;true&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/clash001.png&quot; width=&quot;&quot; height=&quot;&quot; border=&quot;0&quot; vspace=&quot;0&quot; alt=&quot;&quot; title=&quot;&quot; style=&quot;width: 397px; height: 135px;&quot;/&gt;&lt;/p&gt;&lt;p&gt;然后将配置文件上传至 NAS&amp;nbsp; 目录下&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/clash002.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;3、打开 Container Manager → 项目 → 新增 ，直接 docker-compose 部署，&lt;a href=&quot;https://nas.swihp.cn:39997/file/file/clash_compose.yaml&quot; target=&quot;_blank&quot; title=&quot;clash_compose.yaml&quot; textvalue=&quot;clash_compose.yaml&quot;&gt;clash_compose.yaml&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-markdown&quot;&gt;version:&amp;nbsp;&amp;#39;3&amp;#39;
services:
&amp;nbsp;&amp;nbsp;yacd:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;image:&amp;nbsp;haishanh/yacd
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;container_name:&amp;nbsp;yacd
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ports:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;31003:80&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;restart:&amp;nbsp;always&amp;nbsp;&amp;nbsp;#&amp;nbsp;自动重启配置
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;networks:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;clash-network

&amp;nbsp;&amp;nbsp;clash:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;image:&amp;nbsp;dreamacro/clash
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;container_name:&amp;nbsp;clash
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ports:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;7890:7890&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;7891:7891&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;7892:7892&amp;quot;&amp;nbsp;#可以去掉，一般用不到
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;7893:7893&amp;quot;&amp;nbsp;#可以去掉，一般用不到
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;9090:9090&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;volumes:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;./config.yaml:/root/.config/clash/config.yaml&amp;nbsp;&amp;nbsp;&amp;nbsp;#这里很重要
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;restart:&amp;nbsp;always&amp;nbsp;&amp;nbsp;#&amp;nbsp;自动重启配置
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;networks:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;clash-network

networks:
&amp;nbsp;&amp;nbsp;clash-network:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;driver:&amp;nbsp;bridge&lt;/pre&gt;&lt;p&gt;路径很重要 ！！！&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/clash003.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/clash004.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/clash005.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;4、打开 http://NAS_IP:31003 , 在 API Base URL 处输入 http://NAS_IP:9090&amp;nbsp;, 点击 ADD。（！！！“NAS_IP” 是NAS的局域网 IP 地址，一定改成自己NAS的局域网 IP 地址）&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/clash006.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/clash007.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;5、开始开心的玩耍吧&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/clash008.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;NAS本身如果需要走代理也要启用一下，地址添写127.0.0.1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/clash009.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Sat, 09 Aug 2025 23:42:51 +0800</pubDate></item><item><title>群晖Synology NAS docker安装带 web UI 的openvpn</title><link>https://blog.swihp.cn/?id=1431</link><description>&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; position: relative; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-top: 0px !important;&quot;&gt;&lt;h1 tabindex=&quot;-1&quot; class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom: 1px solid rgba(209, 217, 224, 0.7); margin-top: 0px !important;&quot;&gt;openvpn&lt;/h1&gt;&lt;a id=&quot;user-content-openvpn&quot; class=&quot;anchor&quot; aria-label=&quot;Permalink: openvpn&quot; href=&quot;https://github.com/GavinTan/openvpn#openvpn&quot; style=&quot;box-sizing: border-box; background-color: rgba(0, 0, 0, 0); color: rgb(9, 105, 218); float: left; padding-right: 4px; margin: auto; line-height: 1; position: absolute; top: 25.2969px; left: -28px; display: flex; width: 28px; height: 28px; border-radius: 6px; opacity: 0; justify-content: center; align-items: center; transform: translateY(calc(-50% - 0.3rem)); text-underline-offset: 0.2rem;&quot;&gt;&lt;svg class=&quot;octicon octicon-link&quot; viewbox=&quot;0 0 16 16&quot; version=&quot;1.1&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;docker 版&lt;a href=&quot;https://hub.docker.com/r/yyxx/openvpn&quot; rel=&quot;nofollow&quot; style=&quot;box-sizing: border-box; background-color: rgba(0, 0, 0, 0); color: rgb(9, 105, 218); text-underline-offset: 0.2rem;&quot;&gt;openvpn&lt;/a&gt;，支持 web 管理。&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;openvpn 安全与加密相关配置参考于&lt;a href=&quot;https://github.com/angristan/openvpn-install?tab=readme-ov-file#security-and-encryption&quot; style=&quot;box-sizing: border-box; background-color: rgba(0, 0, 0, 0); color: rgb(9, 105, 218); text-underline-offset: 0.2rem;&quot;&gt;openvpn-install&lt;/a&gt;的Security and Encryption部分。&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/openvpn001.png&quot; alt=&quot;openvpn001.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/openvpn002.png&quot; alt=&quot;openvpn002.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/openvpn003.png&quot; alt=&quot;openvpn003.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/openvpn004.png&quot; alt=&quot;openvpn004.png&quot;/&gt;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; position: relative; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;h2 tabindex=&quot;-1&quot; class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; border-bottom: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;一、快速安装&lt;/h2&gt;&lt;a id=&quot;user-content-quick-start&quot; class=&quot;anchor&quot; aria-label=&quot;Permalink: Quick Start&quot; href=&quot;https://github.com/GavinTan/openvpn#quick-start&quot; style=&quot;box-sizing: border-box; background-color: rgba(0, 0, 0, 0); color: rgb(9, 105, 218); float: left; padding-right: 4px; margin: auto; line-height: 1; position: absolute; top: 19.0938px; left: -28px; display: flex; width: 28px; height: 28px; border-radius: 6px; opacity: 0; justify-content: center; align-items: center; transform: translateY(calc(-50% - 0.3rem)); text-underline-offset: 0.2rem;&quot;&gt;&lt;svg class=&quot;octicon octicon-link&quot; viewbox=&quot;0 0 16 16&quot; version=&quot;1.1&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;1、登录群晖 NAS web 管理页面，打开container manager&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;搜索并下载yyxx/openvpn镜像（或者直接导入我下载好的镜像包：&lt;a href=&quot;https://nas.swihp.cn:39997/file/file/yyxx-openvpn.tar&quot; target=&quot;_blank&quot; title=&quot;yyxx-openvpn.tar&quot;&gt;yyxx/openvpn&lt;/a&gt;）&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&amp;nbsp; &amp;nbsp; ssh登录SynologyNAS并切换到root权限&lt;br/&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;login&amp;nbsp;as:&amp;nbsp;sunfeng
sunfeng@192.168.0.100&amp;#39;s&amp;nbsp;password:
sunfeng@SynologyNAS:~$&amp;nbsp;sudo&amp;nbsp;-i
Password:
root@SynologyNAS:~#&amp;nbsp;docker&amp;nbsp;pull&amp;nbsp;yyxx/openvpn&lt;/pre&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/openvpn005.png&quot; width=&quot;&quot; height=&quot;&quot; border=&quot;0&quot; vspace=&quot;0&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;2、新建openvpn证书及配置文件挂载目录&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;在ssh后台直接使用命令创建&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;mkdir&amp;nbsp;-p&amp;nbsp;/volume1/docker/openvpn/data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#路径不要照抄我的，改为自己的实际路径&lt;/pre&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;或者在web页面手动创建&lt;br/&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/openvpn006.png&quot;/&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;初始化生成证书及配置文件&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;cd&amp;nbsp;/volume1/docker/openvpn/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#先&amp;nbsp;cd&amp;nbsp;至openvpn目录下
docker&amp;nbsp;run&amp;nbsp;-v&amp;nbsp;$(pwd)/data:/data&amp;nbsp;--rm&amp;nbsp;yyxx/openvpn&amp;nbsp;--init&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#初始化生成证书及配置文件&lt;/pre&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;3、运行 openvpn&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;以host模式运行openvpn&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;docker&amp;nbsp;run&amp;nbsp;-d&amp;nbsp;\
&amp;nbsp;&amp;nbsp;--name&amp;nbsp;openvpn&amp;nbsp;\
&amp;nbsp;&amp;nbsp;--cap-add&amp;nbsp;NET_ADMIN&amp;nbsp;\
&amp;nbsp;&amp;nbsp;--network&amp;nbsp;host&amp;nbsp;\
&amp;nbsp;&amp;nbsp;-e&amp;nbsp;ADMIN_USERNAME=sunfeng&amp;nbsp;\
&amp;nbsp;&amp;nbsp;-e&amp;nbsp;ADMIN_PASSWORD=sunfeng&amp;nbsp;\
&amp;nbsp;&amp;nbsp;-e&amp;nbsp;OVPN_SUBNET=10.10.8.0/24&amp;nbsp;\
&amp;nbsp;&amp;nbsp;-e&amp;nbsp;WEB_PORT=31194&amp;nbsp;\
&amp;nbsp;&amp;nbsp;-v&amp;nbsp;$(pwd)/data:/data&amp;nbsp;\
&amp;nbsp;&amp;nbsp;-v&amp;nbsp;/etc/localtime:/etc/localtime:ro&amp;nbsp;\
&amp;nbsp;&amp;nbsp;yyxx/openvpn&lt;/pre&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;运行命令不一定照抄我的，可根据自己需求修改环境变量&lt;br/&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;font-size: 1.25em;&quot;&gt;4、compose 安装&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a id=&quot;user-content-compose&quot; class=&quot;anchor&quot; aria-label=&quot;Permalink: compose&quot; href=&quot;https://github.com/GavinTan/openvpn#compose&quot; style=&quot;box-sizing: border-box; background-color: rgba(0, 0, 0, 0); color: rgb(9, 105, 218); float: left; padding-right: 4px; margin: auto; line-height: 1; position: absolute; top: 12.5px; left: -28px; display: flex; width: 28px; height: 28px; border-radius: 6px; opacity: 0; justify-content: center; align-items: center; transform: translateY(-50%); text-underline-offset: 0.2rem;&quot;&gt;&lt;svg class=&quot;octicon octicon-link&quot; viewbox=&quot;0 0 16 16&quot; version=&quot;1.1&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;&quot;&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/openvpn007.png&quot;/&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;&quot;&gt;创建 docker-compose.yml&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;services:
&amp;nbsp;&amp;nbsp;openvpn:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;image:&amp;nbsp;yyxx/openvpn
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cap_add:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;NET_ADMIN
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;network_mode:&amp;nbsp;host&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#不需要host模式可以注释或删除此项，然后取消掉ports的注释
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#ports:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#-&amp;nbsp;&amp;quot;1194:1194/udp&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#-&amp;nbsp;&amp;quot;8833:8833&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;environment:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;ADMIN_USERNAME=sunfeng
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;ADMIN_PASSWORD=sunfeng
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;新增：VPN子网配置（覆盖默认的10.8.0.0/24）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;OVPN_SUBNET=10.10.8.0/24
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;新增：vpn端口（默认端口1194）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;OVPN_PORT=31194
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;新增：vpn协议（默认udp）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;OVPN_PROTO=udp
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;新增：Web管理界面端口（默认8833，可按需修改）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;WEB_PORT=31195
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#-&amp;nbsp;OVPN_IPV6=true
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;volumes:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;./data:/data
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;/etc/localtime:/etc/localtime:ro
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#sysctls:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#-&amp;nbsp;net.ipv6.conf.default.disable_ipv6=0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#-&amp;nbsp;net.ipv6.conf.all.forwarding=1

#networks:
&amp;nbsp;&amp;nbsp;#default:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#enable_ipv6:&amp;nbsp;true&lt;/pre&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;&quot;&gt;&lt;span style=&quot;background-color: #FFFFFF; color: #1F2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/openvpn008.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;&quot;&gt;&lt;span style=&quot;background-color: #FFFFFF; color: #1F2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;创建完成，浏览器访问 https://&amp;nbsp;NAS_IP:31195 即可管理openvpn&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;&quot;&gt;&lt;span style=&quot;background-color: #FFFFFF; color: #1F2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;IPV6&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a id=&quot;user-content-ipv6&quot; class=&quot;anchor&quot; aria-label=&quot;Permalink: IPV6&quot; href=&quot;https://github.com/GavinTan/openvpn#ipv6&quot; style=&quot;box-sizing: border-box; background-color: rgba(0, 0, 0, 0); color: rgb(9, 105, 218); float: left; padding-right: 4px; margin: auto; line-height: 1; position: absolute; top: 19.0938px; left: -28px; display: flex; width: 28px; height: 28px; border-radius: 6px; opacity: 0; justify-content: center; align-items: center; transform: translateY(calc(-50% - 0.3rem)); text-underline-offset: 0.2rem;&quot;&gt;&lt;svg class=&quot;octicon octicon-link&quot; viewbox=&quot;0 0 16 16&quot; version=&quot;1.1&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/p&gt;&lt;blockquote style=&quot;box-sizing: border-box; margin: 0px 0px 16px; padding: 0px 1em; color: rgb(89, 99, 110); border-left: 4px solid rgb(209, 217, 224); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;&quot;&gt;注意：&lt;/p&gt;&lt;ol dir=&quot;auto&quot; style=&quot;box-sizing: border-box; padding-left: 2em;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;启用ipv6后客户端跟服务器的proto需要都指定udp6/tcp6&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;docker的网络需要启用ipv6支持&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;使用openvpn-connect客户端的需要使用3.4.1以后的版本&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;&lt;div class=&quot;highlight highlight-source-shell notranslate position-relative overflow-auto&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; display: flex; justify-content: space-between; background-color: rgb(246, 248, 250); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; position: relative !important; overflow: auto !important;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; font-family: &amp;quot;Monaspace Neon&amp;quot;, ui-monospace, SFMono-Regular, &amp;quot;SF Mono&amp;quot;, Menlo, Consolas, &amp;quot;Liberation Mono&amp;quot;, monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 0px; tab-size: 8; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(246, 248, 250); border-radius: 6px; word-break: normal; min-height: 52px;&quot;&gt;services:
&amp;nbsp;&amp;nbsp;openvpn:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;image:&amp;nbsp;yyxx/openvpn
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cap_add:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;NET_ADMIN
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ports:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;1194:1194/udp&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;8833:8833&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;environment:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;ADMIN_USERNAME=admin
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;ADMIN_PASSWORD=admin
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;OVPN_IPV6=true
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;volumes:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;./data:/data
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;/etc/localtime:/etc/localtime:ro
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sysctls:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;net.ipv6.conf.default.disable_ipv6=0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;net.ipv6.conf.all.forwarding=1

networks:
&amp;nbsp;&amp;nbsp;default:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;enable_ipv6:&amp;nbsp;true&lt;/pre&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; value=&quot;services:
  openvpn:
    image: yyxx/openvpn
    cap_add:
      - NET_ADMIN
    ports:
      - &amp;quot;1194:1194/udp&amp;quot;
      - &amp;quot;8833:8833&amp;quot;
    environment:
      - ADMIN_USERNAME=admin
      - ADMIN_PASSWORD=admin
      - OVPN_IPV6=true
    volumes:
      - ./data:/data
      - /etc/localtime:/etc/localtime:ro
    sysctls:
      - net.ipv6.conf.default.disable_ipv6=0
      - net.ipv6.conf.all.forwarding=1

networks:
  default:
    enable_ipv6: true&quot; tabindex=&quot;0&quot; role=&quot;button&quot; style=&quot;box-sizing: border-box; position: relative; font-size: 14px; line-height: 20px; text-wrap-mode: nowrap; vertical-align: middle; cursor: pointer; user-select: none; border: 0px; border-radius: 6px; appearance: none; color: rgb(9, 105, 218); background-color: rgba(0, 0, 0, 0); box-shadow: none; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; width: 28px; height: 28px; display: flex !important; padding: 0px !important; justify-content: center !important; align-items: center !important; margin: 8px !important;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; height=&quot;16&quot; viewbox=&quot;0 0 16 16&quot; version=&quot;1.1&quot; width=&quot;16&quot; data-view-component=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot;&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; position: relative; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;h2 tabindex=&quot;-1&quot; class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; border-bottom: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;环境变量参数&lt;/h2&gt;&lt;a id=&quot;user-content-环境变量参数&quot; class=&quot;anchor&quot; aria-label=&quot;Permalink: 环境变量参数&quot; href=&quot;https://github.com/GavinTan/openvpn#%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E5%8F%82%E6%95%B0&quot; style=&quot;box-sizing: border-box; background-color: rgba(0, 0, 0, 0); color: rgb(9, 105, 218); float: left; padding-right: 4px; margin: auto; line-height: 1; position: absolute; top: 19.0938px; left: -28px; display: flex; width: 28px; height: 28px; border-radius: 6px; opacity: 0; justify-content: center; align-items: center; transform: translateY(calc(-50% - 0.3rem)); text-underline-offset: 0.2rem;&quot;&gt;&lt;svg class=&quot;octicon octicon-link&quot; viewbox=&quot;0 0 16 16&quot; version=&quot;1.1&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;markdown-accessiblity-table data-catalyst=&quot;&quot; style=&quot;box-sizing: border-box; display: block; color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;&quot;&gt;&lt;/markdown-accessiblity-table&gt;&lt;/p&gt;&lt;table width=&quot;NaN&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;box-sizing: border-box; border-top: 1px solid rgba(209, 217, 224, 0.7);&quot; class=&quot;firstRow&quot;&gt;&lt;th align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;环境变量&lt;/th&gt;&lt;th align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;说明&lt;/th&gt;&lt;th align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&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; border-top: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;OVPN_DATA&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;数据存放目录&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;/data&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; background-color: rgb(246, 248, 250); border-top: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;OVPN_SUBNET&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;vpn子网&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;10.8.0.0/24&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; border-top: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;OVPN_SUBNET6&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;vpn ipv6子网&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;fdaf:f178:e916:6dd0::/64&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; background-color: rgb(246, 248, 250); border-top: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;OVPN_PROTO&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;协议 tcp(6)/udp(6)&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;udp&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; border-top: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;OVPN_PORT&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;vpn连接端口&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;1194&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; background-color: rgb(246, 248, 250); border-top: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;OVPN_MAXCLIENTS&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;vpn最大客户端连接数&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;200&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; border-top: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;OVPN_MANAGEMENT&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;openvpn管理接口监听地址&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;127.0.0.1:7505&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; background-color: rgb(246, 248, 250); border-top: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;OVPN_IPV6&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;启用ipv6&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;false&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; border-top: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;OVPN_GATEWAY&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;启用vpn网关所有流量走vpn&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;false&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; background-color: rgb(246, 248, 250); border-top: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;WEB_PORT&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;web端口&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;8833&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; border-top: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;ADMIN_USERNAME&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;web登录账号&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;admin&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; background-color: rgb(246, 248, 250); border-top: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;ADMIN_PASSWORD&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;web登录密码&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;admin&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; border-top: 1px solid rgba(209, 217, 224, 0.7);&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; margin-bottom: 0px;&quot;&gt;ENV_UPDATE_CONFIG&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;启用环境变量自动更新配置文件&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-image: none 100% / 1 / 0 stretch;&quot;&gt;true&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h2&gt;最后分享一个小技巧，所有需要root登录NAS后台的命令都可以通过计划任务实现&lt;br/&gt;&lt;/h2&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/计划任务001.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Mon, 04 Aug 2025 10:56:06 +0800</pubDate></item><item><title>小米路由器3G R3G 刷入Breed和OpenWrt</title><link>https://blog.swihp.cn/?id=1430</link><description>&lt;p&gt;小米 R3G
市面上有R3G和R3Gv2两种型号, 注意区分, 后者是缩水版, 没有USB口. 内存只有128M, Flash只有16M. 这里描述的只适用于R3G.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;开整&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;注：刷写openwrt需要小米R3G路由器联网（即wan插口连接到intel网络）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;第一步、先给路由器通上电，重置路由器&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;第二步、进入路由器后台192.168.31.1/miwifi.com，将路由器系统 ROM 升级到最新开发版&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;ROM 的升级有两种方式&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;1、登陆路由器后台192.168.31.1在线升级&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;选择下载的文件进行升级。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;2、将升级包拷贝到U盘根目录, 并命名为 miwifi.bin,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;随后断开电源, 插上U盘, 并按住 reset 按钮后插入电源, 等到指示灯变为黄色闪烁(10-15秒)后松开 reset 键,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;之后路由器将更新 ROM 并重启进入正常状态(指示灯变为蓝色常亮)，&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;如果出现异常、失败、U盘无法读取的状况，会进入红灯状态，建议重试或更换U盘再试。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;3、ROM系统成功升级为小米3g开发版是前提条件&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;第三步、绑定完小米账号获取SSH权限&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ①&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;安装 “小米WiFi”手机APP, 连上路由器WIFI后绑定路由器；&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ② 登陆 http://d.miwifi.com/rom/ssh, 点击&amp;quot;下载工具包&amp;quot;；&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ③ ！！！特别提示！！！下载工具包时记下 root 密码（后边会用到）&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;工具包使用方法：小米路由器需升级到开发版0.5.28及以上，小米路由器mini需升级到开发版0.3.84及以上，小米路由器3即将支持。注意：稳定版不支持。&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;&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;&amp;nbsp;&amp;nbsp;.&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;④ 开启 SSH&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;请将下载的工具包bin文件复制到U盘（FAT/FAT32格式）的根目录下，保证文件名为miwifi_ssh.bin；
断开小米路由器的电源，将U盘插入USB接口；
按住reset按钮之后重新接入电源，指示灯变为黄色闪烁状态即可松开reset键；
等待3-5秒后安装完成之后，小米路由器会自动重启，之后您就可以尽情折腾啦&amp;nbsp;：）&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;⑤ 连接SSH&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssh连接方式，&lt;/span&gt;&lt;span style=&quot;text-wrap-mode: nowrap; text-decoration: underline;&quot;&gt;windows尽量别用CMD去连接ssh&lt;/span&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;，推荐工具MobaXterm，putty，xshell等&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;ssh&amp;nbsp;root@192.168.31.1&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;如果ssh连接报错：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;Unable&amp;nbsp;to&amp;nbsp;negotiate&amp;nbsp;with&amp;nbsp;192.168.31.1&amp;nbsp;port&amp;nbsp;22:&amp;nbsp;no&amp;nbsp;matching&amp;nbsp;key&amp;nbsp;exchange&amp;nbsp;method&amp;nbsp;found.&amp;nbsp;Their&amp;nbsp;offer:&amp;nbsp;diffie-hellman-group1-sha1,diffie-hellman-group14-sha1&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;手动指定oKexAlgorithms&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;ssh&amp;nbsp;-oKexAlgorithms=+diffie-hellman-group1-sha1&amp;nbsp;root@192.168.31.1&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;ssh连接&amp;nbsp; ip 地址：192.168.31.1 ，帐号：root，密码：即下载工具包时特别提示保存的root密码&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;第五步、将breed文件上传到路由器 /tmp 目录下，刷入breed&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;！！！&lt;span style=&quot;font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Fira Sans&amp;quot;, &amp;quot;Droid Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;R3G 请使用 2011版的breed&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://nas.swihp.cn:39997/file/file/%E5%B0%8F%E7%B1%B33G/breed-mt7621-xiaomi-r3g.bin&quot; target=&quot;_blank&quot; title=&quot;下载&quot; textvalue=&quot;下载&quot;&gt;下载&lt;/a&gt;&lt;span style=&quot;font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Fira Sans&amp;quot;, &amp;quot;Droid Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;, 不要使用最新2022版的.&lt;/span&gt; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;首先 cd /tmp，&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;到tmp的路径下面，然后将文件breed文件上传到tmp的路径下&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;然后执行这个命令：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;mtd&amp;nbsp;-r&amp;nbsp;write&amp;nbsp;/tmp/breed-mt7621-xiaomi-r3g.bin&amp;nbsp;Bootloader&lt;/pre&gt;&lt;p&gt;回车后路由器会重启，注意&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;观察指示灯，长时间未重启可手动重启。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;重启完成后断电关机&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;然后按住 reset 键，上电直到l ed 闪烁，电脑浏览器访问192.168.1.1即可&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;第六步、恭喜你，已经刷进 breed 了，&lt;/span&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;开始配置breed&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;① 在小米 R3G 设置中, 删除normal_firmware_md5这个键值,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;（参考他人教程提示，未验证不删除是否会导致无法开机）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;②&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;在环境变量编辑中, 添加一个环境变量, 变量名为 xiaomi.r3g.bootfw, 值为2 ，！！！必须设置！！！&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;参数说明&amp;nbsp;xiaomi.r3g.bootfw&amp;nbsp;如果写入&amp;nbsp;Breed&amp;nbsp;到&amp;nbsp;bootloader,&amp;nbsp;这个参数是必须的.&amp;nbsp;Breed的启动流程如下
&amp;nbsp;1、如果&amp;nbsp;kernel0&amp;nbsp;存在,&amp;nbsp;那么启动&amp;nbsp;kernel0
&amp;nbsp;2、如果&amp;nbsp;kernel0&amp;nbsp;不存在,&amp;nbsp;kernel1&amp;nbsp;存在,&amp;nbsp;那么启动&amp;nbsp;kernel1
&amp;nbsp;3、如果&amp;nbsp;kernel0&amp;nbsp;和&amp;nbsp;kernel1&amp;nbsp;都存在,&amp;nbsp;则检查环境变量&amp;nbsp;xiaomi.r3g.bootfw&amp;nbsp;的值,&amp;nbsp;如果存在且值为2,&amp;nbsp;那么启动&amp;nbsp;kernel1,&amp;nbsp;否则启动&amp;nbsp;kernel0&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;如果通过mtd写入了OpenWrt 到Kernel1, 但是不写这个环境变量, Breed就会从kernel0启动,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;无法进入系统, 然后重启, 再次从kernel0启动, 这样一直循环下去.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;至此就配置好breed&lt;/span&gt;&lt;/p&gt;&lt;p&gt;第七步、刷入open wrt&amp;nbsp; 小米3G 底包&lt;/p&gt;&lt;p&gt;1、点击 固件更新 固件项选择后缀为 initramfs.kernel.bin的底包, 闪存布局选择 固件 2 上传 刷入&lt;/p&gt;&lt;p&gt;小米R3G底包下载地址 : &lt;a href=&quot;https://nas.swihp.cn:39997/file/file/%E5%B0%8F%E7%B1%B33G/openwrt-ramips-mt7621-xiaomi_mir3g-initramfs-kernel.bin&quot; target=&quot;_blank&quot; title=&quot;小米 R3G 底包&quot; textvalue=&quot;小米 R3G 底包&quot;&gt;小米 R3G 底包&lt;/a&gt;&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;2、刷完之后，重启进入openwrt，电脑浏览器打开：&lt;a href=&quot;http://192.168.3.1/cgi-bin/luci/admin/system/flashops，&quot; _src=&quot;http://192.168.3.1/cgi-bin/luci/admin/system/flashops，&quot;&gt;http://192.168.3.1/cgi-bin/luci/admin/system/flashops&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt; 如无法打开页面可以看下路由器状态是否重启完成 或 确认下网关是否为 192.168.3.1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;帐号：root&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;密码：password&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;在openwrt管理界面 系统&amp;gt;&amp;gt;备份/升级&amp;gt;&amp;gt;刷写新的固件&amp;gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;选择openwrt-ramips-mt7621-xiaomi_mir3g-squashfs-sysupgrade.bin升级&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;小米R3G sysupgrade系统包下载地址 ：&lt;a href=&quot;https://nas.swihp.cn:39997/file/file/%E5%B0%8F%E7%B1%B33G/openwrt-ramips-mt7621-xiaomi_mir3g-squashfs-sysupgrade.bin&quot; target=&quot;_blank&quot; title=&quot;小米R3G sysupgrade系统包&quot;&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;小米R3G&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;sysupgrade系统包&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;注意：如果用的不是我提供的系统包，刷完 open wrt 后登录用户名密码可能不同&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Fri, 25 Jul 2025 21:32:25 +0800</pubDate></item><item><title>在windows下使用bat脚本“映射网络驱动器”</title><link>https://blog.swihp.cn/?id=1428</link><description>&lt;p&gt;分享一个局域网手动&lt;a href=&quot;https://nas.swihp.cn:39997/file/file/映射网络驱动器.bat&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;映射网络驱动器.bat&lt;/a&gt;脚本：&lt;a href=&quot;https://nas.swihp.cn:39997/file/file/映射网络驱动器.bat&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;下载地址 &lt;/a&gt;&amp;nbsp;，双击脚本，根据提示输入正确信息即可。&lt;/p&gt;&lt;p&gt;外网通过webdav协议映射网络驱动器可以参考&lt;a href=&quot;https://hkc.nasclub.vip/?p=134&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;NAS （外网）映射网络驱动器（windows &amp;amp; mac）&lt;/a&gt;&lt;/p&gt;&lt;hr/&gt;&lt;p&gt;下面分享一个自己写 bat 脚本，每次手动运行，重新映射新的共享文件夹：&lt;/p&gt;&lt;p class=&quot;marklang-paragraph&quot;&gt;直接复制下面的代码内容，在windows电脑上新建txt文本文档并粘贴内容，然后将txt文本文档重命名为“映射网络驱动器脚本.bat”。&lt;/p&gt;&lt;p&gt;！！！名字可以自行随意设置，但是“.bat”这个后缀不要动，在重命名txt文档时一定注意是将“.txt”替换为“.bat”&lt;/p&gt;&lt;pre class=&quot;io-enlighter-pre&quot;&gt;::&amp;nbsp;net&amp;nbsp;use&amp;nbsp;[映射到本地的盘符]&amp;nbsp;[网络磁盘路径]&amp;nbsp;[网络磁盘访问密码]&amp;nbsp;/user:[网络磁盘访问用户名]
::&amp;nbsp;例如：
::&amp;nbsp;net&amp;nbsp;use&amp;nbsp;Z:&amp;nbsp;\\10.10.11.8\Users&amp;nbsp;Admin@123&amp;nbsp;/user:administrator
::&amp;nbsp;将网络磁盘\\10.10.11.8\Users&amp;nbsp;映射到当前的PC的[Z:]上，&amp;nbsp;使用的账号为administrator/Admin@123
::&amp;nbsp;注意不要遗漏&amp;nbsp;&amp;#39;\&amp;#39;与&amp;quot;空格&amp;quot;

::&amp;nbsp;先删除现有映射连接
net&amp;nbsp;use&amp;nbsp;*&amp;nbsp;/del&amp;nbsp;/yes

::&amp;nbsp;创建映射连接
net&amp;nbsp;use&amp;nbsp;Z:&amp;nbsp;\\10.10.1.6\共享文件夹\&amp;nbsp;Admin@123&amp;nbsp;/user:administrator
net&amp;nbsp;use&amp;nbsp;Z:&amp;nbsp;\\10.10.1.6\home\&amp;nbsp;Admin@123&amp;nbsp;/user:administrator&lt;/pre&gt;&lt;hr/&gt;&lt;div data-zone-id=&quot;0&quot; data-line-index=&quot;0&quot; data-line=&quot;true&quot;&gt;在 Windows 下，还可以通过（.bat）脚本映射网络驱动器，并将其设置为开机自动运行。&lt;/div&gt;&lt;div data-zone-id=&quot;0&quot; data-line-index=&quot;1&quot; data-line=&quot;true&quot;&gt;&lt;h3 class=&quot;heading-h3&quot;&gt;一、创建映射网络驱动器的 bat 脚本&lt;/h3&gt;&lt;/div&gt;&lt;ol start=&quot;1&quot; 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;/ol&gt;&lt;pre class=&quot;io-enlighter-pre&quot;&gt;@echo&amp;nbsp;off
REM&amp;nbsp;映射网络驱动器脚本&amp;nbsp;-&amp;nbsp;创建Z盘映射到\\server\share目录
net&amp;nbsp;use&amp;nbsp;Z:&amp;nbsp;\\server\share&amp;nbsp;/persistent:yes&amp;nbsp;/user:domain\username&amp;nbsp;password

REM&amp;nbsp;可选：添加延迟确保网络连接稳定后再映射
REM&amp;nbsp;timeout&amp;nbsp;/t&amp;nbsp;10&amp;nbsp;/nobreak

REM&amp;nbsp;提示映射成功
echo&amp;nbsp;网络驱动器Z:已映射完成！
pause&lt;/pre&gt;&lt;div data-zone-id=&quot;0&quot; data-line-index=&quot;4&quot; data-line=&quot;true&quot;&gt;&lt;strong&gt;参数说明&lt;/strong&gt;：&lt;/div&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;Z:：目标驱动器号，可改为其他未使用的盘符（如 Y:、X: 等）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;\\server\share：实际的共享文件夹路径&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;/persistent:yes：保存映射，重启后保留&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;/user:domain\username password：可选参数，用于指定登录凭据（如需要）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;chcp 65001 &amp;gt;nul&lt;/code&gt;&amp;nbsp;可将编码临时切换为&amp;nbsp;&lt;strong&gt;UTF-8&lt;/strong&gt;&amp;nbsp;，这样可以避免在执行&amp;nbsp;&lt;code&gt;net use&lt;/code&gt;&amp;nbsp;等命令时，因命令输出的字符编码与系统默认编码不一致而产生乱码。&lt;code&gt;&amp;gt;nul&lt;/code&gt;&amp;nbsp;表示将&amp;nbsp;&lt;code&gt;chcp&lt;/code&gt;&amp;nbsp;命令的执行结果输出到空设备，即不显示该命令的执行信息。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;chcp 936 &amp;gt;nul&lt;/code&gt;&amp;nbsp;命令又将编码切换回&amp;nbsp;&lt;strong&gt;GBK&lt;/strong&gt;&amp;nbsp;（代码页 936 代表 GBK 编码），确保后续&amp;nbsp;&lt;code&gt;echo&lt;/code&gt;&amp;nbsp;输出中文时能正常显示。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ol start=&quot;2&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;保存为.bat 文件&lt;/strong&gt;，例如：MapNetworkDrive.bat&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div data-zone-id=&quot;0&quot; data-line-index=&quot;10&quot; data-line=&quot;true&quot;&gt;&lt;h3 class=&quot;heading-h3&quot;&gt;二、设置脚本开机自动运行&lt;/h3&gt;&lt;/div&gt;&lt;div data-zone-id=&quot;0&quot; data-line-index=&quot;11&quot; data-line=&quot;true&quot;&gt;有两种推荐方法：&lt;/div&gt;&lt;div data-zone-id=&quot;0&quot; data-line-index=&quot;12&quot; data-line=&quot;true&quot;&gt;&lt;h4 class=&quot;heading-h4&quot;&gt;方法一：使用系统 “启动” 文件夹（推荐）&lt;/h4&gt;&lt;/div&gt;&lt;ol start=&quot;1&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;按下Win + R 输入cmd 打开运行窗口，输入：&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;shell:startup&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ol start=&quot;2&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;将之前创建的 MapNetworkDrive.bat 文件复制到此文件夹中。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div data-zone-id=&quot;0&quot; data-line-index=&quot;16&quot; data-line=&quot;true&quot;&gt;&lt;h4 class=&quot;heading-h4&quot;&gt;方法二：使用任务计划程序（更灵活）&lt;/h4&gt;&lt;/div&gt;&lt;ol start=&quot;1&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;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ol start=&quot;2&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;/ol&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;常规&lt;/strong&gt;：&lt;/p&gt;&lt;p&gt;名称：自定义（如 &amp;quot;自动映射网络驱动器&amp;quot;）&lt;/p&gt;&lt;p&gt;勾选 “使用最高权限运行”&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;触发器&lt;/strong&gt;：&lt;/p&gt;&lt;p&gt;新建 &amp;gt; 开始任务：选择 “计算机启动时”&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;操作&lt;/strong&gt;：&lt;/p&gt;&lt;p&gt;新建 &amp;gt; 程序 / 脚本：浏览并选择之前创建的.bat 文件&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;条件&lt;/strong&gt;：&lt;/p&gt;&lt;p&gt;取消勾选 “只有在计算机使用交流电源时启动此任务”（如果需要）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div data-zone-id=&quot;0&quot; data-line-index=&quot;28&quot; data-line=&quot;true&quot;&gt;&lt;h3 class=&quot;heading-h3&quot;&gt;三、注意事项&lt;/h3&gt;&lt;/div&gt;&lt;ol start=&quot;1&quot; 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;/ol&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;如果不想在脚本中明文存储密码，可使用：&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;text-indent: 2em;&quot;&gt;net use Z: \\server\share /persistent:yes&lt;/p&gt;&lt;p style=&quot;text-indent: 2em;&quot;&gt;系统会在首次运行时提示输入凭据，并自动保存。&lt;/p&gt;&lt;/ul&gt;&lt;ol start=&quot;2&quot; 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;/ol&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;如果开机后网络连接较慢，可在脚本中添加延迟：&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div data-zone-id=&quot;0&quot; data-line-index=&quot;35&quot; data-line=&quot;true&quot;&gt;&lt;div style=&quot;padding-left: 80px;&quot; data-zone-id=&quot;uwEAGQXEmro9n07ibwTR&quot; data-line-index=&quot;0&quot; data-line=&quot;true&quot;&gt;&lt;code&gt;timeout /t 30 /nobreak REM 等待30秒&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol start=&quot;3&quot; 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;/ol&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;运行脚本后，通过Win + E打开资源管理器，检查是否成功映射。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;使用net use命令查看当前映射状态。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div data-zone-id=&quot;0&quot; data-line-index=&quot;39&quot; data-line=&quot;true&quot;&gt;通过以上步骤，你可以实现网络驱动器的自动映射，并在每次开机时自动连接。&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;marklang-paragraph&quot;&gt;&lt;strong&gt;net use命令&lt;em class=&quot;cos-icon cos-icon-research cosd-markdown-research-icon&quot;&gt;&lt;/em&gt;&lt;/strong&gt;‌主要用于在Windows系统中管理网络连接，包括建立、删除和列出计算机与共享资源的连接。该命令可以在命令提示符（CMD）下使用，适用于各种Windows操作系统版本。&lt;/p&gt;&lt;h3&gt;基本语法和参数&lt;/h3&gt;&lt;p class=&quot;marklang-paragraph&quot;&gt;net use命令的基本语法如下：&lt;/p&gt;&lt;div class=&quot;code-wrapper&quot;&gt;&lt;div class=&quot;code-right&quot;&gt;&lt;code&gt;net use [devicename | *] [\\computername\sharename[\\volume] [password | *] [/user:[domainname\]username] [/smartcard] [/savecred] [[/delete] | [/persistent:{yes | no}]]&lt;br/&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;devicename&lt;/strong&gt;‌：指定一个名字以便与资源相连接，或者指定要切断的设备。可以是磁盘驱动器（如D:至Z:）或打印机（如LPT1:至LPT3:）。使用星号（*）可以分配下一个可用设备名。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;\\computername&lt;/strong&gt;‌：指控制共享资源的计算机的名字（或者使用IP代替）。如果计算机名中包含有空字符，需将双反斜线（\）和计算机名一起用引号（&amp;quot; &amp;quot;）括起来。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;\sharename&lt;/strong&gt;‌：指共享资源的网络名字。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;password&lt;/strong&gt;‌：访问共享资源所需要的密码。使用星号（*）可以提示用户输入密码。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;/user&lt;/strong&gt;‌: 指定用户名和域名，用于登录到远程计算机。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;/smartcard&lt;/strong&gt;‌：使用智能卡进行身份验证。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;/savecred&lt;/strong&gt;‌：保存用户凭据，以便将来使用。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;/delete&lt;/strong&gt;‌：删除现有的连接。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;/persistent&lt;/strong&gt;‌: 设置连接的持久性，yes表示连接在重启后仍然保持，no表示连接在重启后断开。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;使用场景和示例&lt;/h3&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;查看当前网络连接&lt;/strong&gt;‌：不带任何参数使用&lt;code&gt;net use&lt;/code&gt;命令可以列出当前所有的网络连接。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;建立网络连接&lt;/strong&gt;‌：例如，&lt;code&gt;net use Z: \\192.168.1.10\share /user:administrator&lt;/code&gt;会将网络位置&lt;code&gt;\\192.168.1.1\share&lt;/code&gt;映射到本机的Z驱动器，并使用管理员账户登录。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;删除网络连接&lt;/strong&gt;‌：使用&lt;code&gt;net use * /del /y&lt;/code&gt;可以删除所有网络连接。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;管理域登录&lt;/strong&gt;‌：对于需要域登录才能访问的共享资源，可以使用&lt;code&gt;net use \\192.168.1.1\share /user:domain\username&lt;/code&gt;来登录域账户，并访问相应的共享资源。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;高级用法和技巧&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;映射默认共享&lt;/strong&gt;‌：例如，&lt;code&gt;net use Z: \\192.168.1.1\c$&lt;/code&gt;可以将远程主机的C盘映射到本地的Z盘。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;空连接&lt;/strong&gt;‌：使用空字符串作为密码可以建立空连接，例如&lt;code&gt;net use \\192.168.1.1\ipc$ /user:&amp;quot;&amp;quot;&lt;/code&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;‌&lt;strong&gt;删除特定连接&lt;/strong&gt;‌：使用&lt;code&gt;net use \\192.168.1.1\share /delete&lt;/code&gt;可以删除特定的网络连接。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;更多：&lt;/p&gt;&lt;p&gt;net use \\ip\ipc$ &amp;quot;密码&amp;quot; /user:&amp;quot;用户名&amp;quot; 建立IPC非空链接&lt;/p&gt;&lt;p&gt;net use h: \\ip\c$ &amp;quot;密码&amp;quot; /user:&amp;quot;用户名&amp;quot; 直接登陆后映射对方C：到本地为H:&lt;/p&gt;&lt;p&gt;net use h: \\ip\c$ 登陆后映射对方C：到本地为H:&lt;/p&gt;&lt;p&gt;net use \\ip\ipc$ /del 删除IPC链接&lt;/p&gt;&lt;p&gt;net use h: /del 删除映射对方到本地的为H:的映射&lt;/p&gt;&lt;p&gt;net user 用户名　密码　/add 建立用户&lt;/p&gt;&lt;p&gt;net user guest /active:yes 激活guest用户&lt;/p&gt;&lt;p&gt;net user 查看有哪些用户&lt;/p&gt;&lt;p&gt;net user 帐户名 查看帐户的属性&lt;/p&gt;&lt;p&gt;net localgroup administrators 用户名 /add 把“用户”添加到管理员中使其具有管理员权限,注意：administrator后加s用复数&lt;/p&gt;&lt;p&gt;net start 查看开启了哪些服务&lt;/p&gt;&lt;p&gt;net start 服务名　 开启服务；(如:net start telnet， net start schedule)&lt;/p&gt;&lt;p&gt;net stop 服务名 停止某服务&lt;/p&gt;&lt;p&gt;net time \\目标ip 查看对方时间&lt;/p&gt;&lt;p&gt;net time \\目标ip /set 设置本地计算机时间与“目标IP”主机的时间同步,加上参数/yes可取消确认信息&lt;/p&gt;&lt;p&gt;net view 查看本地局域网内开启了哪些共享&lt;/p&gt;&lt;p&gt;net view \\ip 查看对方局域网内开启了哪些共享&lt;/p&gt;&lt;p&gt;net config 显示系统网络设置&lt;/p&gt;&lt;p&gt;net logoff 断开连接的共享&lt;/p&gt;&lt;p&gt;net pause 服务名 暂停某服务&lt;/p&gt;&lt;p&gt;net send ip &amp;quot;文本信息&amp;quot; 向对方发信息&lt;/p&gt;&lt;p&gt;net ver 局域网内正在使用的网络连接嘈秃托畔&lt;/p&gt;&lt;p&gt;net share 查看本地开启的共享&lt;/p&gt;&lt;p&gt;net share ipc&lt;span id=&quot;MathJax-Element-1-Frame&quot; class=&quot;mjx-chtml MathJax_CHTML&quot; style=&quot;display: inline-block; line-height: 0; font-size: 17.22px; font-size-adjust: none; overflow-wrap: normal; word-spacing: normal; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; margin: 0px; padding: 1px 0px; position: relative;&quot; tabindex=&quot;0&quot; role=&quot;presentation&quot; data-mathml=&quot;&amp;lt;math xmlns=&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;gt;&amp;lt;mrow class=&amp;quot;MJX-TeXAtom-ORD&amp;quot;&amp;gt;&amp;lt;mo&amp;gt;&amp;amp;#x5F00;&amp;lt;/mo&amp;gt;&amp;lt;/mrow&amp;gt;&amp;lt;mrow class=&amp;quot;MJX-TeXAtom-ORD&amp;quot;&amp;gt;&amp;lt;mo&amp;gt;&amp;amp;#x542F;&amp;lt;/mo&amp;gt;&amp;lt;/mrow&amp;gt;&amp;lt;mi&amp;gt;i&amp;lt;/mi&amp;gt;&amp;lt;mi&amp;gt;p&amp;lt;/mi&amp;gt;&amp;lt;mi&amp;gt;c&amp;lt;/mi&amp;gt;&amp;lt;/math&amp;gt;&quot;&gt;&lt;span id=&quot;MJXc-Node-1&quot; class=&quot;mjx-math&quot; aria-hidden=&quot;true&quot;&gt;&lt;span id=&quot;MJXc-Node-2&quot; class=&quot;mjx-mrow&quot;&gt;&lt;span id=&quot;MJXc-Node-3&quot; class=&quot;mjx-texatom&quot;&gt;&lt;span id=&quot;MJXc-Node-4&quot; class=&quot;mjx-mrow&quot;&gt;&lt;span id=&quot;MJXc-Node-5&quot; class=&quot;mjx-mo&quot;&gt;&lt;span class=&quot;mjx-char&quot;&gt;&lt;span class=&quot;mjx-charbox MJXc-TeX-unknown-R&quot;&gt;开&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span id=&quot;MJXc-Node-6&quot; class=&quot;mjx-texatom&quot;&gt;&lt;span id=&quot;MJXc-Node-7&quot; class=&quot;mjx-mrow&quot;&gt;&lt;span id=&quot;MJXc-Node-8&quot; class=&quot;mjx-mo&quot;&gt;&lt;span class=&quot;mjx-char&quot;&gt;&lt;span class=&quot;mjx-charbox MJXc-TeX-unknown-R&quot;&gt;启&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span id=&quot;MJXc-Node-9&quot; class=&quot;mjx-mi&quot;&gt;&lt;span class=&quot;mjx-char MJXc-TeX-math-I&quot;&gt;i&lt;/span&gt;&lt;/span&gt;&lt;span id=&quot;MJXc-Node-10&quot; class=&quot;mjx-mi&quot;&gt;&lt;span class=&quot;mjx-char MJXc-TeX-math-I&quot;&gt;p&lt;/span&gt;&lt;/span&gt;&lt;span id=&quot;MJXc-Node-11&quot; class=&quot;mjx-mi&quot;&gt;&lt;span class=&quot;mjx-char MJXc-TeX-math-I&quot;&gt;c&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MJX_Assistive_MathML&quot; role=&quot;presentation&quot;&gt;开启ipc&lt;/span&gt;&lt;/span&gt;&amp;nbsp;共享&lt;/p&gt;&lt;p&gt;net share ipc&lt;span id=&quot;MathJax-Element-2-Frame&quot; class=&quot;mjx-chtml MathJax_CHTML&quot; style=&quot;display: inline-block; line-height: 0; font-size: 17.22px; font-size-adjust: none; overflow-wrap: normal; word-spacing: normal; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; margin: 0px; padding: 1px 0px; position: relative;&quot; tabindex=&quot;0&quot; role=&quot;presentation&quot; data-mathml=&quot;&amp;lt;math xmlns=&amp;quot;http://www.w3.org/1998/Math/MathML&amp;quot;&amp;gt;&amp;lt;mrow class=&amp;quot;MJX-TeXAtom-ORD&amp;quot;&amp;gt;&amp;lt;mo&amp;gt;/&amp;lt;/mo&amp;gt;&amp;lt;/mrow&amp;gt;&amp;lt;mi&amp;gt;d&amp;lt;/mi&amp;gt;&amp;lt;mi&amp;gt;e&amp;lt;/mi&amp;gt;&amp;lt;mi&amp;gt;l&amp;lt;/mi&amp;gt;&amp;lt;mrow class=&amp;quot;MJX-TeXAtom-ORD&amp;quot;&amp;gt;&amp;lt;mo&amp;gt;&amp;amp;#x5220;&amp;lt;/mo&amp;gt;&amp;lt;/mrow&amp;gt;&amp;lt;mrow class=&amp;quot;MJX-TeXAtom-ORD&amp;quot;&amp;gt;&amp;lt;mo&amp;gt;&amp;amp;#x9664;&amp;lt;/mo&amp;gt;&amp;lt;/mrow&amp;gt;&amp;lt;mi&amp;gt;i&amp;lt;/mi&amp;gt;&amp;lt;mi&amp;gt;p&amp;lt;/mi&amp;gt;&amp;lt;mi&amp;gt;c&amp;lt;/mi&amp;gt;&amp;lt;/math&amp;gt;&quot;&gt;&lt;span id=&quot;MJXc-Node-12&quot; class=&quot;mjx-math&quot; aria-hidden=&quot;true&quot;&gt;&lt;span id=&quot;MJXc-Node-13&quot; class=&quot;mjx-mrow&quot;&gt;&lt;span id=&quot;MJXc-Node-14&quot; class=&quot;mjx-texatom&quot;&gt;&lt;span id=&quot;MJXc-Node-15&quot; class=&quot;mjx-mrow&quot;&gt;&lt;span id=&quot;MJXc-Node-16&quot; class=&quot;mjx-mo&quot;&gt;&lt;span class=&quot;mjx-char MJXc-TeX-main-R&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span id=&quot;MJXc-Node-17&quot; class=&quot;mjx-mi&quot;&gt;&lt;span class=&quot;mjx-char MJXc-TeX-math-I&quot;&gt;d&lt;/span&gt;&lt;/span&gt;&lt;span id=&quot;MJXc-Node-18&quot; class=&quot;mjx-mi&quot;&gt;&lt;span class=&quot;mjx-char MJXc-TeX-math-I&quot;&gt;e&lt;/span&gt;&lt;/span&gt;&lt;span id=&quot;MJXc-Node-19&quot; class=&quot;mjx-mi&quot;&gt;&lt;span class=&quot;mjx-char MJXc-TeX-math-I&quot;&gt;l&lt;/span&gt;&lt;/span&gt;&lt;span id=&quot;MJXc-Node-20&quot; class=&quot;mjx-texatom&quot;&gt;&lt;span id=&quot;MJXc-Node-21&quot; class=&quot;mjx-mrow&quot;&gt;&lt;span id=&quot;MJXc-Node-22&quot; class=&quot;mjx-mo&quot;&gt;&lt;span class=&quot;mjx-char&quot;&gt;&lt;span class=&quot;mjx-charbox MJXc-TeX-unknown-R&quot;&gt;删&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span id=&quot;MJXc-Node-23&quot; class=&quot;mjx-texatom&quot;&gt;&lt;span id=&quot;MJXc-Node-24&quot; class=&quot;mjx-mrow&quot;&gt;&lt;span id=&quot;MJXc-Node-25&quot; class=&quot;mjx-mo&quot;&gt;&lt;span class=&quot;mjx-char&quot;&gt;&lt;span class=&quot;mjx-charbox MJXc-TeX-unknown-R&quot;&gt;除&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span id=&quot;MJXc-Node-26&quot; class=&quot;mjx-mi&quot;&gt;&lt;span class=&quot;mjx-char MJXc-TeX-math-I&quot;&gt;i&lt;/span&gt;&lt;/span&gt;&lt;span id=&quot;MJXc-Node-27&quot; class=&quot;mjx-mi&quot;&gt;&lt;span class=&quot;mjx-char MJXc-TeX-math-I&quot;&gt;p&lt;/span&gt;&lt;/span&gt;&lt;span id=&quot;MJXc-Node-28&quot; class=&quot;mjx-mi&quot;&gt;&lt;span class=&quot;mjx-char MJXc-TeX-math-I&quot;&gt;c&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MJX_Assistive_MathML&quot; role=&quot;presentation&quot;&gt;/del删除ipc&lt;/span&gt;&lt;/span&gt;&amp;nbsp;共享&lt;/p&gt;&lt;p&gt;net share c$ /del 删除C：共享&lt;/p&gt;&lt;p&gt;net user guest 12345 用guest用户登陆后用将密码改为12345&lt;/p&gt;&lt;p&gt;net password 密码 更改系统登陆密码&lt;/p&gt;&lt;p&gt;netstat -a 查看开启了哪些端口,常用netstat -an&lt;/p&gt;&lt;p&gt;netstat -n 查看端口的网络连接情况，常用netstat -an&lt;/p&gt;&lt;p&gt;netstat -v 查看正在进行的工作&lt;/p&gt;&lt;p&gt;netstat -p 协议名 例：netstat -p tcq/ip 查看某协议使用情况（查看tcp/ip协议使用情况）&lt;/p&gt;&lt;p&gt;netstat -s 查看正在使用的所有协议使用情况&lt;/p&gt;&lt;p&gt;nbtstat -A ip 对方136到139其中一个端口开了的话，就可查看对方最近登陆的用户名（03前的为用户名）-注意：参数-A要大写&lt;/p&gt;&lt;p&gt;tracert -参数 ip(或计算机名) 跟踪路由（数据包），参数：“-w数字”用于设置超时间隔。&lt;/p&gt;&lt;p&gt;ping ip(或域名) 向对方主机发送默认大小为32字节的数据，参数：“-l[空格]数据包大小”；“-n发送数据次数”；“-t”指一直ping。&lt;/p&gt;&lt;p&gt;ping -t -l 65550 ip 死亡之ping(发送大于64K的文件并一直ping就成了死亡之ping)&lt;/p&gt;&lt;p&gt;ipconfig (winipcfg) 用于windows NT及XP(windows 95 98)查看本地ip地址，ipconfig可用参数“/all”显示全部配置信息&lt;/p&gt;&lt;p&gt;tlist -t 以树行列表显示进程(为系统的附加工具，默认是没有安装的，在安装目录的Support/tools文件夹内)&lt;/p&gt;&lt;p&gt;kill -F 进程名 加-F参数后强制结束某进程(为系统的附加工具，默认是没有安装的，在安装目录的Support/tools文件夹内)&lt;/p&gt;&lt;p&gt;del -F 文件名 加-F参数后就可删除只读文件,/AR、/AH、/AS、/AA分别表示删除只读、隐藏、系统、存档文件，/A-R、/A-H、/A-S、/A-A表示删除除只读、隐藏、系统、存档以外的文件。例如“DEL/AR *.*”表示删除当前目录下所有只读文件，“DEL/A-S *.*”表示删除当前目录下除系统文件以外的所有文件&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 21 May 2025 14:02:51 +0800</pubDate></item><item><title>群晖Synology登录提示：“此 IP 地址已被封锁”，如何解决？</title><link>https://blog.swihp.cn/?id=1426</link><description>&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/IP封锁01.png&quot; width=&quot;282&quot; height=&quot;493&quot; style=&quot;width: 282px; height: 493px;&quot; border=&quot;0&quot; vspace=&quot;0&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/IP封锁02.png&quot;/&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/IP封锁03.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; 您好，我现在登录 NAS 提示 IP 地址已被封锁，无法登录 NAS 盖如何解决？&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; ①联系管理员帮忙修改账号密码&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; ②管理员帐号忘记密码修改方法&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;https://blog.swihp.cn/?id=1323&quot; target=&quot;_blank&quot; textvalue=&quot;如何重置Synology NAS 管理员密码对于DSM 6.2.4 或以上版本&quot;&gt;如何重置Synology NAS 管理员密码对于DSM 6.2.4 或以上版本&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;https://blog.swihp.cn/?id=1326&quot; target=&quot;_blank&quot; textvalue=&quot;如何重置Synology NAS 管理员密码对于 DSM 6.2.3 或更早版本&quot;&gt;如何重置Synology NAS 管理员密码对于 DSM 6.2.3 或更早版本&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;注意：两种方法需要换一台未被封锁IP的电脑操作&lt;br/&gt;&lt;/p&gt;&lt;p&gt;一、修改电脑 IP 地址，直接使用正确帐号密码登录。&lt;br/&gt;&lt;/p&gt;&lt;p&gt;windows电脑按下 win+R 键，输入：&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism- prism-line-numbers language-powershell&quot; data-language=&quot;PowerShell&quot; style=&quot;font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; font-size: 12px; padding: 1em 1em 1em 3.8em; outline: 0px; overflow-wrap: normal; word-break: normal; background-color: rgb(245, 242, 240); text-shadow: white 0px 1px; direction: ltr; line-height: 1.5; tab-size: 4; hyphens: none; overflow: auto; position: relative; counter-reset: linenumber 0;&quot;&gt;C:\Windows\System32\control.exe&amp;nbsp;C:\Windows\System32\ncpa.cpl&lt;/pre&gt;&lt;p&gt;右键点击在用的网络适配器（根据自己的实际情况选择），&lt;/p&gt;&lt;p&gt;选择属性，然后双击 Internet 协议版本4（TCP/IPv4），&lt;/p&gt;&lt;p&gt;选择使用下面的IP地址（根据个人网络情况设置一个新的 IP）&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/IP封锁04.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;二、联系管理员删除被封锁 IP&lt;/p&gt;&lt;p&gt;使用未被封锁 IP 的其他电脑，打开电脑浏览器，输入 NAS IP 地址，&lt;/p&gt;&lt;p&gt;使用管理员帐号登录 NAS 管理页面，&lt;/p&gt;&lt;p&gt;打开控制面板→安全性→防护→允许封锁名单，&lt;/p&gt;&lt;p&gt;删除被封锁的 IP 地址。&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/IP封锁05.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 08 Apr 2025 17:28:08 +0800</pubDate></item><item><title>Synology NAS 出现故障时，如何使用 PC 恢复数据？</title><link>https://blog.swihp.cn/?id=1425</link><description>&lt;div class=&quot;kb_accordion has_accordion&quot; style=&quot;box-sizing: border-box; color: rgb(46, 55, 66); font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;h2 class=&quot;kb_accordion_title&quot; style=&quot;box-sizing: border-box; background-color: transparent; border-bottom: none; margin: 0px; padding: 10px 20px 10px 33px; border-top: 1px solid rgb(234, 236, 242); cursor: pointer; font-size: 21px; line-height: 1.43; position: relative; color: rgb(0, 0, 0) !important;&quot;&gt;目的&lt;/h2&gt;&lt;div class=&quot;kb_accordion_content&quot; style=&quot;box-sizing: border-box; border-top: 1px solid rgb(234, 236, 242); padding-bottom: 5px; padding-left: 33px; padding-top: 0px; position: relative; margin-bottom: 0px !important; margin-top: 0px !important;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 15px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-collapse: collapse; line-height: 1.5; padding-bottom: 0px;&quot;&gt;本文将指导您在 Synology NAS 故障时恢复 PC 上的数据。&lt;/p&gt;&lt;div class=&quot;note&quot; style=&quot;box-sizing: border-box; background-color: rgb(240, 243, 246); border-radius: 10px; margin-bottom: 15px; margin-top: 15px; padding: 15px;&quot;&gt;&lt;p class=&quot;note_title&quot; style=&quot;box-sizing: border-box; border-collapse: collapse; line-height: 1.5; margin-bottom: 0px; padding-bottom: 0px; font-weight: 600;&quot;&gt;注意：&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;a id=&quot;x_anchor_id573948425f&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;&lt;/a&gt;硬盘迁移到新 NAS 后，可能无法再次挂载卷。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;kb_accordion has_accordion&quot; style=&quot;box-sizing: border-box; color: rgb(46, 55, 66); font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;h2 class=&quot;kb_accordion_title&quot; style=&quot;box-sizing: border-box; background-color: transparent; border-bottom: none; margin: 0px; padding: 10px 20px 10px 33px; border-top: 1px solid rgb(234, 236, 242); cursor: pointer; font-size: 21px; line-height: 1.43; position: relative; color: rgb(0, 0, 0) !important;&quot;&gt;&lt;a id=&quot;x_anchor_id0ba29c6a1a&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;&lt;/a&gt;环境&lt;/h2&gt;&lt;div class=&quot;kb_accordion_content&quot; style=&quot;box-sizing: border-box; border-top: 1px solid rgb(234, 236, 242); padding-bottom: 5px; padding-left: 33px; padding-top: 0px; position: relative; margin-bottom: 0px !important; margin-top: 0px !important;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 15px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-collapse: collapse; line-height: 1.5; padding-bottom: 0px;&quot;&gt;适用于：&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;DSM 版本 6.2.x 及以上&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;使用 Btrfs 或 ext4 文件系统的卷&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Ubuntu 版本 18.04 (下载&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;ubuntu-18.04-desktop-amd64.iso&lt;/span&gt;&lt;a href=&quot;https://old-releases.ubuntu.com/releases/18.04/&quot; rel=&quot;noopener noreferrer nofollow&quot; target=&quot;_blank&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-decoration-line: none; color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;这里&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;box-sizing: border-box; border-collapse: collapse; line-height: 1.5; padding-bottom: 0px;&quot;&gt;不适用于：&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;使用读写 SSD 缓存的卷&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;kb_accordion has_accordion&quot; style=&quot;box-sizing: border-box; color: rgb(46, 55, 66); font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;h2 class=&quot;kb_accordion_title&quot; style=&quot;box-sizing: border-box; background-color: transparent; border-bottom: none; margin: 0px; padding: 10px 20px 10px 33px; border-top: 1px solid rgb(234, 236, 242); cursor: pointer; font-size: 21px; line-height: 1.43; position: relative; color: rgb(0, 0, 0) !important;&quot;&gt;&lt;a id=&quot;x_anchor_idb5a4b64b2a&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;&lt;/a&gt;解决方案&lt;/h2&gt;&lt;div class=&quot;kb_accordion_content&quot; style=&quot;box-sizing: border-box; border-top: 1px solid rgb(234, 236, 242); padding-bottom: 5px; padding-left: 33px; padding-top: 0px; position: relative; margin-bottom: 0px !important; margin-top: 0px !important;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 15px;&quot;&gt;&lt;h3 style=&quot;box-sizing: border-box; background-color: transparent; border-bottom: none; margin: 15px 0px 5px; padding-top: 0px; font-size: 18px; color: rgb(0, 0, 0) !important;&quot;&gt;&lt;a id=&quot;x_anchor_id32571c7e4c&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;&lt;/a&gt;使用 PC 恢复数据&lt;/h3&gt;&lt;ol class=&quot;type_lower-decimal list-paddingleft-2&quot; style=&quot;box-sizing: border-box; border-collapse: collapse; line-height: 1.5; margin-bottom: 15px; padding-bottom: 0px; padding-left: 1.25em;&quot;&gt;&lt;li&gt;&lt;p&gt;确保您的 PC 具有足够的硬盘插槽以安装硬盘。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;从 Synology NAS 中取出硬盘并将其安装到 PC 中。对于 RAID 或 SHR 配置，您必须同时在 PC 中安装所有硬盘（不包括 Hot Spare 硬盘）。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;按照&lt;a href=&quot;https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-windows#0&quot; rel=&quot;noopener noreferrer nofollow&quot; target=&quot;_blank&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-decoration-line: none; color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;本教程&lt;/a&gt;中的说明准备 Ubuntu 环境。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;前往左侧栏的&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;文件&lt;/span&gt;并选择&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;Home&lt;/span&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;右键单击并选择&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;新建文件夹&lt;/span&gt;，创建一个或多个文件夹作为装载点以访问数据。&lt;sup style=&quot;box-sizing: border-box;&quot;&gt;&lt;a href=&quot;https://kb.synology.cn/zh-cn/DSM/tutorial/How_can_I_recover_data_from_my_DiskStation_using_a_PC#x_anchor_id01&quot; scroll-to=&quot;#x_anchor_id01&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-decoration-line: none; color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;右键单击新文件夹，点击&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;属性&lt;/span&gt;，父文件夹的文件夹名称为&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;${mount_point}&lt;/code&gt;&amp;nbsp;。&lt;/p&gt;&lt;/li&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;示例：如果父文件夹是&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;/home/ubuntu/&lt;/code&gt;&amp;nbsp;，文件夹名称是&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Test&lt;/code&gt;&amp;nbsp;，则装载点将是&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;/home/ubuntu/Test/&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p&gt;前往左下角的&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;显示应用程序&lt;/span&gt;&amp;nbsp;&amp;gt;&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;输入搜索...&lt;/span&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;在搜索栏中输入&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;终端&lt;/span&gt;并选择&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;终端&lt;/span&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;输入以下命令以获取 root 权限。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px 20px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;sudo -i&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;输入以下命令以安装&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;mdadm&lt;/code&gt;&amp;nbsp;和&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;lvm2&lt;/code&gt;&amp;nbsp;，它们都是 RAID 管理工具。必须安装&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;lvm2&lt;/code&gt;&amp;nbsp;，否则&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;vgchange&lt;/code&gt;&amp;nbsp;将无法工作。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px 20px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;apt-get update&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;apt-get install -y mdadm lvm2&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;输入以下命令以组装从 Synology NAS 中取出的所有硬盘。结果可能会根据 Synology NAS 上的存储池配置而有所不同。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px 20px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;mdadm -AsfR &amp;amp;&amp;amp; vgchange -ay&lt;/code&gt;&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;输入以下命令以获取&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;${device_path}&lt;/code&gt;&amp;nbsp;的信息。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;cat /proc/mdstat&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;lvs&lt;/code&gt;&lt;/div&gt;&lt;p&gt;根据&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;pvs/vgs/lvs&lt;/code&gt;&amp;nbsp;的输出，设备路径如下：&lt;/p&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr class=&quot;firstRow&quot;&gt;&lt;td width=&quot;489&quot; valign=&quot;top&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;489&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; font-weight: 600; text-align: center; text-wrap-mode: wrap; background-color: #F7F9FB;&quot;&gt;${device_path}&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&quot;489&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; color: #2E3742; font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; text-align: center; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;无 lvs 输出&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;489&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; color: rgb(46, 55, 66); font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;/dev/${md}&lt;/code&gt;&lt;a href=&quot;https://kb.synology.cn/zh-cn/DSM/tutorial/How_can_I_recover_data_from_my_DiskStation_using_a_PC#x_anchor_id02&quot; scroll-to=&quot;#x_anchor_id02&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-decoration-line: none; color: rgb(0, 103, 230); font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;sup style=&quot;box-sizing: border-box;&quot;&gt;2&lt;/sup&gt;&lt;/a&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&quot;489&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; color: #2E3742; font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; text-align: center; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;有 lvs 输出&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;489&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; color: rgb(46, 55, 66); font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;/dev/${VG}/${LV}&lt;/code&gt;&lt;a href=&quot;https://kb.synology.cn/zh-cn/DSM/tutorial/How_can_I_recover_data_from_my_DiskStation_using_a_PC#x_anchor_id03&quot; scroll-to=&quot;#x_anchor_id03&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-decoration-line: none; color: rgb(0, 103, 230); font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;sup style=&quot;box-sizing: border-box;&quot;&gt;3&lt;/sup&gt;&lt;/a&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;span style=&quot;color: #2E3742; font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;以下是&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; color: rgb(46, 55, 66); font-size: 16px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;md status&lt;/code&gt;&lt;span style=&quot;color: #2E3742; font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;&amp;nbsp;对应其 RAID 和卷类型的示例：&lt;/span&gt;&lt;/p&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr class=&quot;firstRow&quot;&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; font-weight: 600; text-align: center; text-wrap-mode: wrap; background-color: #F7F9FB;&quot;&gt;设备路径&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; font-weight: 600; text-align: center; text-wrap-mode: wrap; background-color: #F7F9FB;&quot;&gt;单卷经典 RAID&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; color: #2E3742; font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; text-align: center; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;cat /proc/mdstat&lt;/code&gt;&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;root@ubuntu:~# cat /proc/mdstat&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;Personalities : [raid1]&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;md4&lt;/span&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;: active raid1 sdc3[0]&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;73328704 blocks super 1.2 [1/1] [U]&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;unused devices:&amp;lt;none&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; color: #2E3742; font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; text-align: center; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; color: #2E3742; font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; text-align: center; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;lvs&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;无输出&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; color: #2E3742; font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; text-align: center; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;${device_path}&lt;/code&gt;&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;/dev/md4&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;table width=&quot;1445&quot;&gt;&lt;tbody&gt;&lt;tr class=&quot;firstRow&quot;&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;font-weight: 600; text-align: center; background-color: #F7F9FB;&quot;&gt;设备路径&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;font-weight: 600; text-align: center; background-color: #F7F9FB;&quot;&gt;单卷 SHR&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-align: center;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;cat /proc/mdstat&lt;/code&gt;&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;root@ubuntu:~# cat /proc/mdstat&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Personalities : [raid1]&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;md3 : active raid1 sda5[0]&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;73328704 blocks super 1.2 [2/2] [UU]&lt;br/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;unused devices:&amp;lt;none&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-align: center;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif;&quot;&gt;lvs&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;root@ubuntu:~# lvs&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;LV VG&lt;/span&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;&amp;nbsp;Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;lv vg1000&lt;/span&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;&amp;nbsp;-wi-a----- 69.92g&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-align: center;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;${device_path}&lt;/code&gt;&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;/dev/vg1000/lv&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table width=&quot;1445&quot;&gt;&lt;tbody&gt;&lt;tr class=&quot;firstRow&quot;&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;font-weight: 600; text-align: center; background-color: #F7F9FB;&quot;&gt;设备路径&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;font-weight: 600; text-align: center; background-color: #F7F9FB;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif; font-size: 16px; font-weight: 600; text-align: center; text-wrap-mode: wrap; background-color: #F7F9FB;&quot;&gt;多卷经典 RAID/SHR&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-align: center;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;cat /proc/mdstat&lt;/code&gt;&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;Personalities : [raid1]&lt;br/&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;md3 : active raid1 sdc3[0] sdd3[1]&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;73328704 blocks super 1.2 [2/2] [UU]&lt;br/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;unused devices:&amp;lt;none&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-align: center;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: Inter, Arial, Helvetica, 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;, Verdana, sans-serif;&quot;&gt;lvs&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;root@ubuntu:~# lvs&lt;br/&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;LV VG&lt;/span&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;&amp;nbsp;Attr LSize Pool Origin Data% Meta% Move Log Cpy% Sync Convert&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;syno_vg_reserved_area vg1 -wi-a----- 12.00m&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;volume_1 vg1&lt;/span&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;&amp;nbsp;-wi-a----- 30.00g&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;volume_3 vg1&lt;/span&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;&amp;nbsp;-wi-a----- 30.00g&lt;/span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-align: center;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;${device_path}&lt;/code&gt;&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;td width=&quot;647&quot; valign=&quot;top&quot; style=&quot;word-break: break-all;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;/dev/vg1/volume_1&lt;br/&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #2E3742; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;/dev/vg1/volume_3&lt;/span&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;输入以下命令以只读方式装载所有硬盘以访问您的数据。在&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;${device_path}&lt;/code&gt;&amp;nbsp;中输入您的设备路径（根据&lt;a href=&quot;https://kb.synology.cn/zh-cn/DSM/tutorial/How_can_I_recover_data_from_my_DiskStation_using_a_PC#x_anchor_idstep12&quot; scroll-to=&quot;#x_anchor_idstep12&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-decoration-line: none; color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;步骤 12&lt;/a&gt;&amp;nbsp;中的 RAID 和卷类型），在&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;${mount_point}&lt;/code&gt;&amp;nbsp;中输入装载点（在&lt;a href=&quot;https://kb.synology.cn/zh-cn/DSM/tutorial/How_can_I_recover_data_from_my_DiskStation_using_a_PC#x_anchor_idstep6&quot; scroll-to=&quot;#x_anchor_idstep6&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-decoration-line: none; color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;步骤 6&lt;/a&gt;&amp;nbsp;中创建）。您的数据将放置在装载点下。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px 20px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;mount ${device_path} ${mount_point} -o ro&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;在&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;文件&lt;/span&gt;&amp;nbsp;&amp;gt;&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;Home&lt;/span&gt;&amp;nbsp;&amp;gt;您在&lt;a href=&quot;https://kb.synology.cn/zh-cn/DSM/tutorial/How_can_I_recover_data_from_my_DiskStation_using_a_PC#x_anchor_idstep5&quot; scroll-to=&quot;#x_anchor_idstep5&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-decoration-line: none; color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;步骤 5&lt;/a&gt;&amp;nbsp;中创建的文件夹中检查数据。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;对于加密的存储空间和共享文件夹：&lt;/p&gt;&lt;/li&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://kb.synology.cn/zh-cn/DSM/tutorial/How_can_I_recover_data_from_my_DiskStation_using_a_PC#x_anchor_encryptedvolume&quot; scroll-to=&quot;#x_anchor_encryptedvolume&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-decoration-line: none; color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;在 PC 上装载加密存储空间&lt;/a&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://kb.synology.cn/zh-cn/DSM/tutorial/How_can_I_recover_data_from_my_DiskStation_using_a_PC#x_anchor_encrypted&quot; scroll-to=&quot;#x_anchor_encrypted&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-decoration-line: none; color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;在 PC 上装载加密共享文件夹&lt;/a&gt;。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;p style=&quot;box-sizing: border-box; border-collapse: collapse; line-height: 1.5; padding-bottom: 0px;&quot;&gt;如果通过上述步骤仍无法恢复数据，请避免尝试其他修复方法，因为这可能会对您的数据造成更大的损害。作为最后的选择，请寻求当地数据救援公司的帮助。请理解，数据检索仍然无法保证。&lt;/p&gt;&lt;h3 style=&quot;box-sizing: border-box; background-color: transparent; border-bottom: none; margin: 15px 0px 5px; padding-top: 0px; font-size: 18px; color: rgb(0, 0, 0) !important;&quot;&gt;&lt;a id=&quot;x_anchor_encryptedvolume&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;&lt;/a&gt;在 PC 上装载加密存储空间&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; border-collapse: collapse; line-height: 1.5; padding-bottom: 0px;&quot;&gt;确保您拥有加密存储空间的恢复密钥。以下步骤仅在恢复密钥正确的情况下有效。&lt;/p&gt;&lt;ol class=&quot;type_lower-decimal list-paddingleft-2&quot; style=&quot;box-sizing: border-box; border-collapse: collapse; line-height: 1.5; margin-bottom: 15px; padding-bottom: 0px; padding-left: 1.25em;&quot;&gt;&lt;li&gt;&lt;p&gt;在&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;终端机&lt;/span&gt;中，输入以下命令以安装&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;cryptsetup&lt;/code&gt;&amp;nbsp;。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px 20px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;apt-get install cryptsetup&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;输入以下命令以解码您的恢复密钥。将&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;${your_recovery_key_path}&lt;/code&gt;&amp;nbsp;替换为恢复密钥的位置，并将&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;${base64_decode_output_path}&lt;/code&gt;&amp;nbsp;替换为所需的输出文件名和位置。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;base64 --decode ${your_recovery_key_path} &amp;gt; ${base64_decode_output_path}&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;示例：如果恢复密钥位于&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;/mnt/volume1.rkey&lt;/code&gt;&amp;nbsp;，并且您希望输出文件命名为&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;decode_output&lt;/code&gt;&amp;nbsp;并位于&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;/mnt&lt;/code&gt;&amp;nbsp;，则输入的命令将是：&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;base64 --decode /mnt/volume1.rkey &amp;gt; /mnt/decode_output&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p&gt;输入以下命令以测试恢复密钥是否正确。将&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;${base64_decode_output_path}&lt;/code&gt;&amp;nbsp;替换为输出文件名和位置。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;cryptsetup open --test-passphrase /dev/vgX/volume_Y -S 1 -d ${base64_decode_output_path} -v&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;示例：如果输出文件名为&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;decode_output&lt;/code&gt;&amp;nbsp;并位于&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;/mnt&lt;/code&gt;&amp;nbsp;，则输入的命令将是：&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;cryptsetup open --test-passphrase /dev/vgX/volume_Y -S 1 -d /mnt/decode_output -v&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p&gt;检查结果以查看恢复密钥是否正确：&lt;/p&gt;&lt;/li&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;正确的密钥：&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px 20px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Key slot 1 unlocked.&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;Command successful.&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;错误的密钥：&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px 20px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;No key available with this passphrase.&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;Command failed with code -2 (no permission or bad passphrase).&lt;/code&gt;&lt;/div&gt;&lt;p&gt;找到正确的密钥并返回上一步重新解码。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p&gt;输入以下命令以使用解码后的恢复密钥解密加密存储空间。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px 20px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;cryptsetup open --allow-discards /dev/vgX/volume_Y cryptvol_Y -S 1 -d ${base64_decode_output_path}&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;输入以下命令以只读方式装载所有硬盘以访问您的数据。将&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;${device_path}&lt;/code&gt;&amp;nbsp;替换为您的设备路径&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;/dev/mapper/cryptvol_Y&lt;/code&gt;&amp;nbsp;，并将&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;${mount_point}&lt;/code&gt;&amp;nbsp;替换为在&lt;a href=&quot;https://kb.synology.cn/zh-cn/DSM/tutorial/How_can_I_recover_data_from_my_DiskStation_using_a_PC#x_anchor_idstep6&quot; scroll-to=&quot;#x_anchor_idstep6&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-decoration-line: none; color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;步骤 6&lt;/a&gt;&amp;nbsp;中创建的装载点。您的数据将放置在装载点下。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px 20px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;mount ${device_path} ${mount_point} -o ro&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;请参阅&lt;a href=&quot;https://kb.synology.cn/zh-cn/DSM/tutorial/How_can_I_recover_data_from_my_DiskStation_using_a_PC#x_anchor_idstep14&quot; scroll-to=&quot;#x_anchor_idstep14&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-decoration-line: none; color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;步骤 14&lt;/a&gt;&amp;nbsp;以恢复您的数据。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 style=&quot;box-sizing: border-box; background-color: transparent; border-bottom: none; margin: 15px 0px 5px; padding-top: 0px; font-size: 18px; color: rgb(0, 0, 0) !important;&quot;&gt;&lt;a id=&quot;x_anchor_encrypted&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;&lt;/a&gt;在 PC 上装载加密共享文件夹&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; border-collapse: collapse; line-height: 1.5; padding-bottom: 0px;&quot;&gt;确保您拥有加密共享文件夹的加密密钥。以下步骤仅在加密密钥正确时有效。&lt;/p&gt;&lt;ol class=&quot;type_lower-decimal list-paddingleft-2&quot; style=&quot;box-sizing: border-box; border-collapse: collapse; line-height: 1.5; margin-bottom: 15px; padding-bottom: 0px; padding-left: 1.25em;&quot;&gt;&lt;li&gt;&lt;p&gt;在&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;终端机&lt;/span&gt;中，输入以下命令以获取 root 权限。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px 20px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;sudo -i&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;输入以下命令以启用&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;universe repo&lt;/code&gt;&amp;nbsp;并安装&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;ecryptfs-utils&lt;/code&gt;&amp;nbsp;。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px 20px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;apt-get-repository universe&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;apt-get update&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;apt-get install ecryptfs-utils&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;输入以下命令以获取加密密钥的 FNEK（文件名加密密钥）值。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;ecryptfs-add-passphrase --fnek&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;ol class=&quot;type_lower-alpha list-paddingleft-2&quot; style=&quot;list-style-type: lower-alpha;&quot;&gt;&lt;li&gt;&lt;p&gt;当提示时，将您的加密密钥输入到&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Passphrase&lt;/code&gt;&amp;nbsp;字段。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;您将看到类似以下的输出：&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px 20px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Inserted auth tok with sig [79d78a9afb5ebc95] into the user session keyring&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;Inserted auth tok with sig&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;[e4e4e8a3ca7d5d54]&lt;/span&gt;&amp;nbsp;into the user session keyring&lt;/code&gt;&lt;/div&gt;&lt;p&gt;第二个方括号内的值是您的 FNEK 值。请记下此值，因为您将在后续步骤中需要它。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;&lt;p&gt;使用&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;cd&lt;/code&gt;&amp;nbsp;命令导航到您在上一节&lt;a href=&quot;https://kb.synology.cn/zh-cn/DSM/tutorial/How_can_I_recover_data_from_my_DiskStation_using_a_PC#x_anchor_idstep6&quot; scroll-to=&quot;#x_anchor_idstep6&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-decoration-line: none; color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;步骤 6&lt;/a&gt;&amp;nbsp;中创建的装载点。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;cd&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;${mount_point}&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;示例：如果装载点&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;${mount_point}&lt;/code&gt;&amp;nbsp;是&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;/home/ubuntu/Test/&lt;/code&gt;&amp;nbsp;，则输入的命令将如下所示：&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;cd /home/ubuntu/Test/&lt;/code&gt;&amp;nbsp;。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p&gt;创建一个临时文件夹作为加密共享文件夹的装载点。使用&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;mkdir&lt;/code&gt;&amp;nbsp;命令创建一个新文件夹。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;mkdir&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;folder_name&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;p&gt;在上述命令中，将&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;folder_name&lt;/code&gt;&amp;nbsp;替换为您想要给文件夹命名的名称。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;输入以下命令以装载您的加密共享文件夹。&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;mount -t ecryptfs&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;folder_name&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;p&gt;确保将&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;folder_name&lt;/code&gt;&amp;nbsp;替换为您在上一步中创建的临时文件夹的名称。要完成装载，还需要额外的输入。请按照以下说明操作：&lt;/p&gt;&lt;/li&gt;&lt;ol class=&quot;type_lower-alpha list-paddingleft-2&quot; style=&quot;list-style-type: lower-alpha;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Passphrase&lt;/code&gt;&amp;nbsp;：输入您的加密密钥。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Select cipher&lt;/code&gt;&amp;nbsp;：输入&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;1&lt;/code&gt;&amp;nbsp;以选择&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;aes&lt;/span&gt;作为加密算法。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Select key bytes&lt;/code&gt;&amp;nbsp;：输入&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;2&lt;/code&gt;&amp;nbsp;以选择&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;32&lt;/span&gt;作为密钥字节数。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Enable plaintext passthrough&lt;/code&gt;&amp;nbsp;：输入&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;n&lt;/code&gt;&amp;nbsp;以禁用此选项。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Enable filename encryption&lt;/code&gt;&amp;nbsp;：输入&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;y&lt;/code&gt;&amp;nbsp;以启用此选项。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Filename Encryption Key (FNEK) Signature&lt;/code&gt;&amp;nbsp;：输入您在&lt;a href=&quot;https://kb.synology.cn/zh-cn/DSM/tutorial/How_can_I_recover_data_from_my_DiskStation_using_a_PC#x_anchor_idstep3&quot; scroll-to=&quot;#x_anchor_idstep3&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-decoration-line: none; color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;步骤 3&lt;/a&gt;&amp;nbsp;中获取的 FNEK 值。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;输入您的 FNEK 值后，您将看到类似以下的输出：&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px 20px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Attempting to mount with the following options:&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;ecryptfs_unlink_sigs&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;ecryptfs_fnek_sig=e4e4e8a3ca7d5d54&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;ecryptfs_key_bytes=32&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;ecryptfs_cipher=aes&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;ecryptfs_sig=79d78a9afb5ebc95&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;WARNING: Based on the contents of [/root/.ecryptfs/sig-cache.txt], it looks like you have never mounted with this key before. This could mean that you have typed your passphrase wrong.&lt;/code&gt;&lt;/div&gt;&lt;p&gt;警告信息只是一个提醒。如果您已确认您的加密密钥是正确的，可以安全地忽略此警告并继续。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Would you like to proceed with the mount&lt;/code&gt;&amp;nbsp;：输入&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;y&lt;/code&gt;&amp;nbsp;以同意继续装载。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Would you like to append sig … in order to avoid this warning in the future&lt;/code&gt;&amp;nbsp;：输入&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;n&lt;/code&gt;&amp;nbsp;以继续。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;如果装载成功，您将看到以下输出：&lt;/p&gt;&lt;div class=&quot;code_div&quot; style=&quot;box-sizing: border-box; background-color: rgb(249, 249, 249); border: 1px dotted rgb(204, 204, 204); font-size: 13px; margin: 10px 0px 20px; padding: 10px; word-break: break-all;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;Mounted eCryptfs&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;div class=&quot;note&quot; style=&quot;box-sizing: border-box; background-color: rgb(240, 243, 246); border-radius: 10px; margin-bottom: 15px; margin-top: 15px; padding: 15px;&quot;&gt;&lt;p class=&quot;note_title&quot; style=&quot;box-sizing: border-box; border-collapse: collapse; line-height: 1.5; margin-bottom: 0px; padding-bottom: 0px; font-weight: 600;&quot;&gt;注意：&lt;/p&gt;&lt;ol class=&quot;type_lower-decimal list-paddingleft-2&quot; style=&quot;box-sizing: border-box; border-collapse: collapse; line-height: 1.5; padding-bottom: 0px; padding-left: 1.25em;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;a id=&quot;x_anchor_id01&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;&lt;/a&gt;一个装载点等于一个存储空间。如果您有多个需要恢复的存储空间，请创建与存储空间数量相同的文件夹。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;a id=&quot;x_anchor_id02&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;&lt;/a&gt;md（阵列）的数量将在&amp;nbsp;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;cat /proc/mdstat&lt;/code&gt;&amp;nbsp;的结果中列出。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;a id=&quot;x_anchor_id03&quot; style=&quot;box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(0, 103, 230); font-weight: inherit;&quot;&gt;&lt;/a&gt;&lt;code style=&quot;box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, monospace, &amp;quot; serif&amp;quot;;&quot;&gt;syno_vg_reserved_area&lt;/code&gt;&amp;nbsp;可以忽略，volume_x 的数量等于存储空间的数量。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Thu, 13 Mar 2025 13:34:29 +0800</pubDate></item><item><title>Synology群晖利用Easytier开源方案实现去中心化的免费内网穿透</title><link>https://blog.swihp.cn/?id=1424</link><description>&lt;h2 style=&quot;box-sizing: border-box; margin: 0px; line-height: 40px; font-size: 32px; overflow-wrap: break-word; position: relative; outline: none; letter-spacing: -0.02em; color: rgb(60, 60, 67); font-family: Inter, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;font-family: 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;; font-size: 24px;&quot;&gt;&lt;span style=&quot;color: #24292E; font-family: &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Luxi Sans&amp;quot;, &amp;quot;DejaVu Sans&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft Yahei&amp;quot;, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Android Emoji&amp;quot;, EmojiSymbols; font-size: 16px; font-variant-ligatures: no-common-ligatures; letter-spacing: 0.4px; text-wrap-mode: wrap; background-color: #FFFFFF;&quot;&gt;官网网址：&lt;/span&gt;&lt;a href=&quot;https://www.easytier.top/guide/introduction.html&quot; target=&quot;_blank&quot; style=&quot;overflow-wrap: break-word; --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; --tw-rotate: 0; --tw-skew-x: 0; --tw-skew-y: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-pan-x: ; --tw-pan-y: ; --tw-pinch-zoom: ; --tw-scroll-snap-strictness: proximity; --tw-gradient-from-position: ; --tw-gradient-via-position: ; --tw-gradient-to-position: ; --tw-ordinal: ; --tw-slashed-zero: ; --tw-numeric-figure: ; --tw-numeric-spacing: ; --tw-numeric-fraction: ; --tw-ring-inset: ; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-shadow: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-shadow-colored: 0 0 #0000; --tw-blur: ; --tw-brightness: ; --tw-contrast: ; --tw-grayscale: ; --tw-hue-rotate: ; --tw-invert: ; --tw-saturate: ; --tw-sepia: ; --tw-drop-shadow: ; --tw-backdrop-blur: ; --tw-backdrop-brightness: ; --tw-backdrop-contrast: ; --tw-backdrop-grayscale: ; --tw-backdrop-hue-rotate: ; --tw-backdrop-invert: ; --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; --tw-contain-size: ; --tw-contain-layout: ; --tw-contain-paint: ; --tw-contain-style: ; color: rgb(51, 102, 153); font-family: &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Luxi Sans&amp;quot;, &amp;quot;DejaVu Sans&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft Yahei&amp;quot;, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Android Emoji&amp;quot;, EmojiSymbols; font-size: 16px; font-variant-ligatures: no-common-ligatures; letter-spacing: 0.4px; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;简介 | EasyTier&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2 style=&quot;box-sizing: border-box; margin: 0px; line-height: 40px; font-size: 32px; overflow-wrap: break-word; position: relative; outline: none; letter-spacing: -0.02em; color: rgb(60, 60, 67); font-family: Inter, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;font-family: 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;; font-size: 24px;&quot;&gt;功能概览&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;font-family: 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;; font-size: 14px;&quot;&gt;一个简单、安全、去中心化的内网穿透 SD-WAN 异地组网方案，使用 Rust 语言和 Tokio 框架实现。&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;; background-color: #FFFFFF; color: #3C3C43; font-size: 24px; letter-spacing: -0.02em;&quot;&gt;特点&lt;/span&gt;&lt;/h2&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: disc;&quot;&gt;&lt;li&gt;&lt;p&gt;去中心化：无需依赖中心化服务，节点平等且独立。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;安全：支持利用 WireGuard 加密通信，也支持 AES-GCM 加密保护中转流量。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;高性能：全链路零拷贝，性能与主流组网软件相当。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;跨平台：支持 MacOS/Linux/Windows/FreeBSD/Android，未来将支持 IOS。可执行文件静态链接，部署简单。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;无公网 IP 组网：支持利用共享的公网节点组网，可参考&amp;nbsp;&lt;a href=&quot;https://easytier.cn/guide/network/networking-without-public-ip.html&quot; target=&quot;_blank&quot;&gt;配置指南&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;NAT 穿透：支持基于 UDP 的 NAT 穿透，即使在复杂的网络环境下也能建立稳定的连接。&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;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;TCP 支持：在 UDP 受限的情况下，通过并发 TCP 链接提供可靠的数据传输，优化性能。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;高可用性：支持多路径和在检测到高丢包率或网络错误时切换到健康路径。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;IPV6 支持：支持利用 IPV6 组网。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;安装方式：&lt;br/&gt;&lt;/h2&gt;&lt;p&gt;1、打开群晖web管理页面→Container manager→映像→操作→导入→从文件添加→从本地设备，导入easytier映像（&lt;span style=&quot;color: #FF0000;&quot;&gt;！！！如果你的docker可以直接联网下载映像请直接忽略此步&lt;/span&gt;）&lt;br/&gt;&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: disc;&quot;&gt;&lt;li&gt;&lt;p&gt;easytier2.2.2版本，直接下载并导入docker即可使用&amp;nbsp;&lt;a href=&quot;https://nas.swihp.cn:39997/file/file/easytier.tar&quot; target=&quot;_blank&quot;&gt;easytier.tar&lt;/a&gt; /&amp;nbsp;&lt;a href=&quot;https://nas.swihp.cn:39997/file/file/watchtower.tar&quot; target=&quot;_blank&quot;&gt;watchtower.tar&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/easytier001.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;2、打开Container Manager→项目→新增：在来源处选择创建docker-compose.yml&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/easytier002.png&quot;/&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-php&quot;&gt;version:&amp;nbsp;&amp;#39;3.8&amp;#39;
services:
&amp;nbsp;&amp;nbsp;watchtower:&amp;nbsp;#&amp;nbsp;用于自动更新easytier镜像，若不需要请删除这部分
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;command:&amp;nbsp;--interval&amp;nbsp;3600&amp;nbsp;--cleanup&amp;nbsp;--label-enable
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;container_name:&amp;nbsp;watchtower
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;environment:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;TZ=Asia/Shanghai
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;WATCHTOWER_NO_STARTUP_MESSAGE
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;image:&amp;nbsp;containrrr/watchtower
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;restart:&amp;nbsp;always
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;volumes:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;/var/run/docker.sock:/var/run/docker.sock
&amp;nbsp;&amp;nbsp;easytier:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;restart:&amp;nbsp;always
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;labels:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;com.centurylinklabs.watchtower.enable:&amp;nbsp;&amp;#39;true&amp;#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;privileged:&amp;nbsp;true
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mem_limit:&amp;nbsp;0m
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;container_name:&amp;nbsp;easytier
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hostname:&amp;nbsp;easytier
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;network_mode:&amp;nbsp;host
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;volumes:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;/etc/easytier:/root
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;environment:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;TZ=Asia/Shanghai
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;image:&amp;nbsp;easytier/easytier:latest
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;command:&amp;nbsp;-i&amp;nbsp;&amp;lt;ip&amp;gt;&amp;nbsp;--network-name&amp;nbsp;&amp;lt;用户&amp;gt;&amp;nbsp;--network-secret&amp;nbsp;&amp;lt;密码&amp;gt;&amp;nbsp;-p&amp;nbsp;tcp://&amp;lt;服务器地址&amp;gt;:11010&lt;/pre&gt;&lt;p&gt;-- watchtower 部分用于自动更新easytier，如果不需要或者docker不能联网下载映像可以直接删除这部分，仅保留easytier部分&lt;/p&gt;&lt;p&gt;---- container_name:&amp;nbsp;easytier # 容器名称&lt;/p&gt;&lt;p&gt;---- hostname:&amp;nbsp;easytier # 设备名称，可自定义（字母开头，可以后跟数字）&lt;br/&gt;&lt;/p&gt;&lt;p&gt;---- /etc/easytier:/root # 这个路径需要注意，在群晖上需要修改一下，例：/volume1/docker/easytier:/root&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;---- &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-i &amp;lt;ip&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # 此节点的IPv4地址，例：-i 10.10.9.1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --network-name&amp;nbsp;&amp;lt;用户&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #&amp;nbsp;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;网络名称，默认为default&lt;/span&gt;&lt;/p&gt;&lt;p&gt;----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --network-secret &amp;lt;密码&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# 网络密钥，默认为空&lt;/p&gt;&lt;p&gt;----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -p&amp;nbsp;tcp://&amp;lt;服务器地址&amp;gt;:11010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # 初始要连接的对等节点&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -e tcp://&amp;lt;服务器地址&amp;gt;:11010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #&amp;nbsp;&lt;/span&gt;使用公共共享节点来发现对等节点。&lt;/p&gt;&lt;p&gt;----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -l 11010 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# 监听端口&lt;/p&gt;&lt;p&gt;----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -n 192.168.1.0/24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#将此设备可访问的子网共享给其他节点访问&lt;/p&gt;&lt;p&gt;3、构建并启动项目&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/easytier003.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/easytier004.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;4、在实际使用环境中将群晖NAS作为服务端使用，可以去掉 -p&amp;nbsp;tcp://&amp;lt;服务器地址&amp;gt;:11010&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;停止项目→YAML配置，可以修改command配置&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/easytier005.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;5、下载并安装电脑/手机端，访问公司内网设备&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://easytier.cn/guide/download.html&quot; target=&quot;_blank&quot;&gt;Easytier 下载地址&lt;/a&gt;：&lt;a href=&quot;https://easytier.cn/guide/download.html&quot; target=&quot;_blank&quot;&gt;https://easytier.cn/guide/download.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;6、windows端配置&lt;/p&gt;&lt;p&gt;虚拟IPv4地址：默认是勾选DHCP的，推荐手动设置&lt;/p&gt;&lt;p&gt;网络名称： --network-name&amp;nbsp;&lt;/p&gt;&lt;p&gt;网络密码： --network-secret&lt;/p&gt;&lt;p&gt;网络方式：手动&amp;nbsp; &amp;nbsp;tcp:// IP或域名 :30100&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://nas.swihp.cn:39997/file/wordpress/synology/easytier006.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;如需共享windows电脑所在的子网给其他设备访问可以在高级设置中配置 “子网代理CIDR”，例：192.168.1.0/24&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;！！！如果公司没有公网IP可以使用公共服务器，不会配置的地方可以加我微信或邮件私聊&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #212529; font-family: BlinkMacSystemFont, &amp;quot;segoe ui&amp;quot;, Roboto, &amp;quot;helvetica neue&amp;quot;, Arial, &amp;quot;noto sans&amp;quot;, sans-serif, &amp;quot;apple color emoji&amp;quot;, &amp;quot;segoe ui emoji&amp;quot;, &amp;quot;segoe ui symbol&amp;quot;, &amp;quot;noto color emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: #0DCAF0;&quot;&gt;项目部署教程 :&lt;/span&gt;&lt;a href=&quot;https://doc.oee.icu/&quot; style=&quot;box-sizing: border-box; font-family: BlinkMacSystemFont, &amp;quot;segoe ui&amp;quot;, Roboto, &amp;quot;helvetica neue&amp;quot;, Arial, &amp;quot;noto sans&amp;quot;, sans-serif, &amp;quot;apple color emoji&amp;quot;, &amp;quot;segoe ui emoji&amp;quot;, &amp;quot;segoe ui symbol&amp;quot;, &amp;quot;noto color emoji&amp;quot;; font-size: 16px; text-wrap-mode: wrap; background-color: rgb(13, 202, 240);&quot;&gt;https://doc.oee.icu&lt;/a&gt;&lt;/p&gt;</description><pubDate>Tue, 04 Mar 2025 12:34:48 +0800</pubDate></item></channel></rss>