<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>linux &#8211; Lhy&#039;s blog</title>
	<atom:link href="https://blog.lhyshome.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.lhyshome.com</link>
	<description>welcome</description>
	<lastBuildDate>Tue, 17 Mar 2026 10:23:45 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
<site xmlns="com-wordpress:feed-additions:1">219834889</site>	<item>
		<title>Ubuntu创建root用户</title>
		<link>https://blog.lhyshome.com/2026/03/11/377/</link>
					<comments>https://blog.lhyshome.com/2026/03/11/377/#respond</comments>
		
		<dc:creator><![CDATA[lhy]]></dc:creator>
		<pubDate>Wed, 11 Mar 2026 12:24:34 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[小技巧]]></category>
		<category><![CDATA[脚本]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://blog.lhyshome.com/?p=377</guid>

					<description><![CDATA[手动执行： 在 Ubuntu 24.04 桌面版中，出于系统安全考虑，root 用户是被默认禁止直接登录图形界… <span class="read-more"><a href="https://blog.lhyshome.com/2026/03/11/377/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[
<h1 class="wp-block-heading">手动执行：</h1>



<p>在 Ubuntu 24.04 桌面版中，出于系统安全考虑，root 用户是被默认禁止直接登录图形界面的。如果你确实需要以 root 身份操作桌面，可以按照以下步骤进行配置。</p>



<p><strong><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 重要提示</strong>：启用 root 账户登录会带来极大的安全风险。root 拥有系统的最高权限，任何误操作（如误删系统文件）都可能导致系统崩溃或数据丢失。建议仅在必要时（如系统维护、特定测试）开启，用完即关。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">操作步骤</h3>



<h4 class="wp-block-heading">第一步：为 root 用户设置密码</h4>



<p>首先，你需要为 root 账户激活一个密码。打开终端，执行以下命令：</p>



<pre class="wp-block-code"><code>sudo passwd root</code></pre>



<p>系统会提示你输入并确认新的 root 密码。输入密码时屏幕不会有任何显示，这是正常的。</p>



<h4 class="wp-block-heading">第二步：修改 GDM 配置文件</h4>



<p>GDM (GNOME Display Manager) 是 Ubuntu 的登录管理器，需要修改其配置以允许 root 登录。</p>



<ol class="wp-block-list">
<li>使用 <code>nano</code> 编辑器打开配置文件（你也可以用 <code>vim</code> 或 <code>gedit</code> 替代 <code>nano</code>）： <br><code>sudo nano /etc/gdm3/custom.conf</code></li>



<li>在文件中找到 <code>[security]</code> 这一行。如果找不到，可以手动在文件末尾添加。在 <code>[security]</code> 下方添加一行，内容如下： <br><code>[security] </code><br><code>AllowRoot=true</code></li>



<li>按 <code>Ctrl+O</code> 保存文件，然后按 <code>Ctrl+X</code> 退出编辑器。</li>
</ol>



<h4 class="wp-block-heading">第三步：修改 PAM 认证配置</h4>



<p>PAM (Pluggable Authentication Modules) 是系统的认证模块，它里面有一条规则明确禁止 root 登录图形界面，我们需要把它注释掉。</p>



<ol class="wp-block-list">
<li>编辑第一个 PAM 文件： <br><code>sudo nano /etc/pam.d/gdm-password</code> <br>找到下面这一行，并在行首添加一个 <code>#</code> 号将其注释掉： <br><code># auth required pam_succeed_if.so user != root quiet_success</code> <br>保存并退出 (<code>Ctrl+O</code>, <code>Ctrl+X</code>)。</li>



<li>用同样的方法编辑第二个 PAM 文件：<br><code>sudo nano /etc/pam.d/gdm-autologin</code><br>同样找到并注释掉这一行：<br><code># auth required pam_succeed_if.so user != root quiet_success</code><br>保存并退出。</li>
</ol>



<h4 class="wp-block-heading">第四步：（可选）修复 root 用户的环境配置文件</h4>



<p>首次以 root 登录时，可能会遇到一个关于 <code>/.profile</code> 文件的错误提示。为了避免这个问题，可以提前修复它。</p>



<ol class="wp-block-list">
<li>编辑 root 目录下的 <code>.profile</code> 文件： <br><code>sudo nano /root/.profile</code></li>



<li>找到文件的最后一行，通常是： <br><code>mesg n 2&gt; /dev/null || true</code></li>



<li>将其修改为：<br><code>tty -s &amp;&amp; mesg n || true</code><br>保存并退出。</li>
</ol>



<h4 class="wp-block-heading">第五步：重启系统</h4>



<p>所有配置完成后，需要重启系统以使更改生效：</p>



<pre class="wp-block-code"><code>sudo reboot</code></pre>



<h4 class="wp-block-heading">第六步：以 root 身份登录</h4>



<p>系统重启后，在登录界面，你会发现列表中没有 root 用户。此时，需要点击 <strong>“未列出？”</strong> 或者 <strong>“Other”</strong> 选项。</p>



<p>在弹出的输入框中，用户名输入 <code>root</code>，密码输入你在第一步设置的密码，即可登录到 GNOME 桌面。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 完成后的小建议</strong><br>完成你的工作后，为了系统安全，建议你按照操作步骤的反向操作，将配置改回去（即注释掉 <code>AllowRoot=true</code>，并恢复 PAM 文件中被注释的行），然后重启系统，恢复使用普通用户。</p>



<h1 class="wp-block-heading">脚本执行</h1>



<div class="wp-block-file"><a id="wp-block-file--media-12f8c3e0-ad76-4157-983a-8d3b4f9fecc6" href="https://blog.lhyshome.com/wp-content/uploads/2026/03/ubuntu-root-login.zip">ubuntu-root-login.zip</a><a href="https://blog.lhyshome.com/wp-content/uploads/2026/03/ubuntu-root-login.zip" class="wp-block-file__button wp-element-button" download aria-describedby="wp-block-file--media-12f8c3e0-ad76-4157-983a-8d3b4f9fecc6">下载</a></div>



<p>上述文件包含</p>



<figure class="wp-block-image size-full"><img decoding="async" width="221" height="89" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-17.png" alt="" class="wp-image-382"/></figure>



<p>enable-root-login.sh 是开启root权限的一键脚本<br>disable-root-login.sh 是关闭root登陆权限的一键脚本</p>



<p><strong>1. 赋予执行权限：</strong></p>



<p>chmod +x enable-root-login.sh<br>或者<br><code>chmod +x disable-root-login.sh</code></p>



<p><strong>2.用 sudo 执行：</strong></p>



<p>sudo ./enable-root-login.sh<br>或者<br><code>sudo ./disable-root-login.sh</code></p>



<h1 class="wp-block-heading">脚本执行成功后</h1>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1019" height="735" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-20.png" alt="" class="wp-image-387" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-20.png 1019w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-20-300x216.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-20-768x554.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-20-660x476.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-20-500x361.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-20-800x577.png 800w" sizes="(max-width: 1019px) 100vw, 1019px" /></figure>



<p>点击&#8221;未列出?&#8221;，就可以使用root用户，用<strong>执行命令行所填的密码</strong>来登录ubuntu桌面版系统了</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1019" height="736" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-19.png" alt="" class="wp-image-386" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-19.png 1019w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-19-300x217.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-19-768x555.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-19-660x477.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-19-500x361.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-19-800x578.png 800w" sizes="(max-width: 1019px) 100vw, 1019px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lhyshome.com/2026/03/11/377/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">377</post-id>	</item>
		<item>
		<title>OpenClaw配置飞书</title>
		<link>https://blog.lhyshome.com/2026/03/11/416/</link>
					<comments>https://blog.lhyshome.com/2026/03/11/416/#respond</comments>
		
		<dc:creator><![CDATA[lhy]]></dc:creator>
		<pubDate>Wed, 11 Mar 2026 11:30:06 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[小技巧]]></category>
		<category><![CDATA[生活]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[openclaw]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[飞书]]></category>
		<guid isPermaLink="false">https://blog.lhyshome.com/?p=416</guid>

					<description><![CDATA[飞书开发者平台： https://accounts.feishu.cn/accounts/page/login… <span class="read-more"><a href="https://blog.lhyshome.com/2026/03/11/416/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">飞书开发者平台：</h2>



<p>https://accounts.feishu.cn/accounts/page/login?app_id=7&#038;no_trap=1&#038;redirect_uri=https%3A%2F%2Fopen.feishu.cn%2Fapp</p>



<h2 class="wp-block-heading">扫描二维码登录自己的飞书账号</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="451" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-43-1024x451.png" alt="" class="wp-image-417" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-43-1024x451.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-43-300x132.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-43-768x338.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-43-1536x677.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-43-660x291.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-43-500x220.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-43-800x353.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-43-1280x564.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-43.png 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">进入后点击“创建企业自建应用”</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="217" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-44-1024x217.png" alt="" class="wp-image-418" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-44-1024x217.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-44-300x63.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-44-768x162.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-44-1536x325.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-44-660x140.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-44-500x106.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-44-800x169.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-44-1280x271.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-44.png 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">点击机器人下面的“+添加”</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="349" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-46-1024x349.png" alt="" class="wp-image-420" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-46-1024x349.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-46-300x102.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-46-768x262.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-46-1536x524.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-46-660x225.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-46-500x171.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-46-800x273.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-46-1280x437.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-46.png 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">配置权限管理</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="890" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-47-1024x890.png" alt="" class="wp-image-421" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-47-1024x890.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-47-300x261.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-47-768x668.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-47-660x574.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-47-500x435.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-47-800x696.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-47.png 1181w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">批量导入权限，将下面json粘贴进框里</h2>



<pre class="wp-block-code"><code>{
  "scopes": {
    "tenant": &#91;
      "im:message",
      "im:message.group_at_msg:readonly",
      "im:message.p2p_msg:readonly",
      "im:message:send_as_bot",
      "im:resource",
      "contact:user.employee_id:readonly"
    ],
    "user": &#91;]
  }
}</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="623" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-48-1024x623.png" alt="" class="wp-image-422" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-48-1024x623.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-48-300x182.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-48-768x467.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-48-1536x934.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-48-660x401.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-48-500x304.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-48-800x487.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-48-1280x779.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-48.png 1774w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">申请开通权限</h2>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="905" height="377" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-49.png" alt="" class="wp-image-423" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-49.png 905w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-49-300x125.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-49-768x320.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-49-660x275.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-49-500x208.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-49-800x333.png 800w" sizes="auto, (max-width: 905px) 100vw, 905px" /></figure>



<h2 class="wp-block-heading">配置完成后，将app id，和app secret复制下来</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="456" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-50-1024x456.png" alt="" class="wp-image-424" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-50-1024x456.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-50-300x133.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-50-768x342.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-50-1536x683.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-50-660x294.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-50-500x222.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-50-800x356.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-50-1280x570.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-50.png 1690w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">在OpenClaw的配置步骤中将上图的对应配置贴入</h2>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="469" height="452" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-51.png" alt="" class="wp-image-425" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-51.png 469w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-51-300x289.png 300w" sizes="auto, (max-width: 469px) 100vw, 469px" /></figure>



<h2 class="wp-block-heading">配置完OpenClaw后，执行openclaw gateway启动OpenClaw</h2>



<h2 class="wp-block-heading">返回飞书页面，进入下图菜单，点击红框按钮，配置事件与回调</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="834" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-52-1024x834.png" alt="" class="wp-image-426" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-52-1024x834.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-52-300x244.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-52-768x626.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-52-660x538.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-52-500x407.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-52-800x652.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-52.png 1205w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">选择“消息与群组”，勾选“接受消息”</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="435" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-53-1024x435.png" alt="" class="wp-image-427" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-53-1024x435.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-53-300x128.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-53-768x326.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-53-1536x653.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-53-660x281.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-53-500x213.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-53-800x340.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-53-1280x544.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-53.png 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">完成后点击红框中的“创建版本”</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="672" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-54-1024x672.png" alt="" class="wp-image-428" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-54-1024x672.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-54-300x197.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-54-768x504.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-54-1536x1009.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-54-660x433.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-54-500x328.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-54-800x525.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-54-1280x840.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-54.png 1794w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">填写版本号和更新说明</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="775" height="1024" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-55-775x1024.png" alt="" class="wp-image-429" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-55-775x1024.png 775w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-55-227x300.png 227w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-55-768x1015.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-55-660x872.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-55-500x661.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-55-800x1057.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-55.png 874w" sizes="auto, (max-width: 775px) 100vw, 775px" /></figure>



<h2 class="wp-block-heading">发布版本后，飞书消息列表“开发者小助手”提示应用审批通过，点击“打开应用”</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="590" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-56-1024x590.png" alt="" class="wp-image-430" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-56-1024x590.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-56-300x173.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-56-768x442.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-56-660x380.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-56-500x288.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-56-800x461.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-56.png 1118w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">第一次对话，“弹出以下”聊天信息</h2>



<h2 class="wp-block-heading">将消息最后一行复制，贴入命令行窗口，执行</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="384" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-57-1024x384.png" alt="" class="wp-image-431" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-57-1024x384.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-57-300x113.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-57-768x288.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-57-660x248.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-57-500x188.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-57-800x300.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-57.png 1130w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="131" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-58-1024x131.png" alt="" class="wp-image-432" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-58-1024x131.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-58-300x38.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-58-768x98.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-58-1536x197.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-58-660x85.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-58-500x64.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-58-800x103.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-58-1280x164.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-58.png 1615w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">命令执行成功后，执行命令 openclaw gateway restart 重启OpenClaw</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="585" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-59-1024x585.png" alt="" class="wp-image-433" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-59-1024x585.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-59-300x171.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-59-768x439.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-59-660x377.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-59-500x286.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-59-800x457.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-59.png 1120w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">重启成功后机器人就可以正常对话聊天</h2>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lhyshome.com/2026/03/11/416/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">416</post-id>	</item>
		<item>
		<title>Ubuntu桌面版系统下安装OpenClaw（养龙虾）</title>
		<link>https://blog.lhyshome.com/2026/03/11/389/</link>
					<comments>https://blog.lhyshome.com/2026/03/11/389/#respond</comments>
		
		<dc:creator><![CDATA[lhy]]></dc:creator>
		<pubDate>Wed, 11 Mar 2026 10:52:12 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[小技巧]]></category>
		<category><![CDATA[生活]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[openclaw]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://blog.lhyshome.com/?p=389</guid>

					<description><![CDATA[前言 本文为Linux环境安装，Windows环境博主未作尝试，见谅！ 在Windows中使用虚拟机安装，建议… <span class="read-more"><a href="https://blog.lhyshome.com/2026/03/11/389/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">前言</h2>



<p>本文为<strong>Linux环境</strong>安装，Windows环境博主未作尝试，见谅！</p>



<p>在Windows中使用虚拟机安装，建议<strong>内存&gt;32G</strong>，且系统在Windows10以上，需要<strong>开启Windows系统自带的Hyper-v虚拟机</strong>程序，本文对如何使用Hyper-v不再多做赘述。</p>



<p>出于<strong>安全</strong>考虑和第一次尝鲜，博主的OpenClaw是安装在Windows系统下<strong>Hyper-v虚拟机</strong>中，部署的是<strong>ubuntu-24.04.1-desktop-amd64</strong>操作系统。<br>Ubuntu虚拟机要求：建议 2核CPU、4GB内存以上，40GB可用磁盘空间（可视情况扩展）<br>博主使用的是：10核CPU、8GB动态内存，120GB可用磁盘空间</p>



<p>关键字：<br><strong>OpenClaw 2026.3.8、Windows、Hyper-v虚拟机、ubuntu-24.04.1-desktop、</strong><br><strong>Linux、minimax 2.5、飞书（feishu）</strong></p>



<p>以下是博主踩坑后总结的安装流程</p>



<h2 class="wp-block-heading">安装前准备工作：</h2>



<p><strong>申请大模型api：</strong>根据自己的喜好选择。（博主使用的是minimax2.5 模型试用）</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="467" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-23-1024x467.png" alt="" class="wp-image-392" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-23-1024x467.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-23-300x137.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-23-768x351.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-23-660x301.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-23-500x228.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-23-800x365.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-23.png 1058w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>飞书的聊天机器人配置</strong></p>



<p><strong>获取Ubuntu的最高root权限：</strong>（因为龙虾可能需要很高的操作权限，所以安置在root下）<br>命令行登录后 使用<br>sudo -i<br>输入登录用户密码后，进入root用户权限</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="330" height="64" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-21.png" alt="" class="wp-image-390" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-21.png 330w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-21-300x58.png 300w" sizes="auto, (max-width: 330px) 100vw, 330px" /></figure>



<p><strong>创建root用户：</strong><a href="https://blog.lhyshome.com/2026/03/11/377/">https://blog.lhyshome.com/2026/03/11/377/</a></p>



<p><strong>更新系统与安装基础工具</strong>：<br>打开终端，逐行执行以下命令，确保系统包是最新的，并安装 <code>curl</code> 和 <code>wget</code> 等必要工具。 <br><code>apt update &amp;&amp; sudo apt upgrade -y </code><br><code>apt install -y curl wget git python3 build-essential</code></p>



<p><strong>安装 Node.js</strong>：<br>OpenClaw 的核心依赖是 Node.js，<strong>必须安装 22.x 或更高版本</strong>。通过官方源安装是最稳定的方法。 <br><code># 添加 NodeSource 22.x 仓库 </code><br><code>curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - </code><br><code># 安装 Node.js 和 npm </code><br><code>apt install -y nodejs </code><br><code># 验证安装版本 </code><br><code>node --version # 应输出 v22.x.x</code></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="338" height="39" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-22.png" alt="" class="wp-image-391" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-22.png 338w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-22-300x35.png 300w" sizes="auto, (max-width: 338px) 100vw, 338px" /></figure>



<p><strong>（可选）国内环境优化</strong>：<br>如果你在境内，执行以下命令将 npm 镜像源切换到淘宝源，可以大幅提升下载速度和成功率。<br><code>npm config set registry https://registry.npmmirror.com</code></p>



<h2 class="wp-block-heading">安装OpenClaw：</h2>



<p><strong>官方一键安装脚本（最推荐）</strong>这个脚本会自动完成Node.js检测、CLI安装，并立即启动配置向导。 </p>



<pre class="wp-block-code"><code><code>curl -fsSL https://openclaw.ai/install.sh | bash</code></code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="573" height="378" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/8fc54c5b-7b2d-4498-a728-cb6076bd7ce2-1.png" alt="" class="wp-image-404" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/8fc54c5b-7b2d-4498-a728-cb6076bd7ce2-1.png 573w, https://blog.lhyshome.com/wp-content/uploads/2026/03/8fc54c5b-7b2d-4498-a728-cb6076bd7ce2-1-300x198.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/8fc54c5b-7b2d-4498-a728-cb6076bd7ce2-1-500x330.png 500w" sizes="auto, (max-width: 573px) 100vw, 573px" /></figure>



<h2 class="wp-block-heading">配置OpenClaw：（以下是博主的配置，可以参考）</h2>



<p>安装完成后命令行自动进入配置安装，后续也可以使用 openclaw onboard 命令进行配置</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="834" height="911" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-24.png" alt="" class="wp-image-393" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-24.png 834w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-24-275x300.png 275w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-24-768x839.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-24-660x721.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-24-500x546.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-24-800x874.png 800w" sizes="auto, (max-width: 834px) 100vw, 834px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="545" height="73" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-25.png" alt="" class="wp-image-394" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-25.png 545w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-25-300x40.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-25-500x67.png 500w" sizes="auto, (max-width: 545px) 100vw, 545px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="306" height="555" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-26.png" alt="" class="wp-image-395" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-26.png 306w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-26-165x300.png 165w" sizes="auto, (max-width: 306px) 100vw, 306px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="421" height="128" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-27.png" alt="" class="wp-image-396" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-27.png 421w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-27-300x91.png 300w" sizes="auto, (max-width: 421px) 100vw, 421px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="312" height="79" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-28.png" alt="" class="wp-image-397" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-28.png 312w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-28-300x76.png 300w" sizes="auto, (max-width: 312px) 100vw, 312px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="763" height="205" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-30.png" alt="" class="wp-image-399" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-30.png 763w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-30-300x81.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-30-660x177.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-30-500x134.png 500w" sizes="auto, (max-width: 763px) 100vw, 763px" /></figure>



<p>点击链接，进入页面后选择授权</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="608" height="532" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-31.png" alt="" class="wp-image-400" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-31.png 608w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-31-300x263.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-31-500x438.png 500w" sizes="auto, (max-width: 608px) 100vw, 608px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="763" height="613" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-32.png" alt="" class="wp-image-401" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-32.png 763w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-32-300x241.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-32-660x530.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-32-500x402.png 500w" sizes="auto, (max-width: 763px) 100vw, 763px" /></figure>



<p>此处注意和飞书中的先后次序（可以参考：<a href="https://blog.lhyshome.com/2026/03/11/416/">https://blog.lhyshome.com/2026/03/11/416/</a>），要是配置错误页没关系，可以重复执行openclaw onboard 命令进行配置</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="475" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-33-1024x475.png" alt="" class="wp-image-405" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-33-1024x475.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-33-300x139.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-33-768x356.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-33-1536x713.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-33-660x306.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-33-500x232.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-33-800x371.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-33-1280x594.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-33.png 1631w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="436" height="172" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-34.png" alt="" class="wp-image-406" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-34.png 436w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-34-300x118.png 300w" sizes="auto, (max-width: 436px) 100vw, 436px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="205" height="54" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-35.png" alt="" class="wp-image-407" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-35.png 205w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-35-200x54.png 200w" sizes="auto, (max-width: 205px) 100vw, 205px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="358" height="61" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-36.png" alt="" class="wp-image-408" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-36.png 358w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-36-300x51.png 300w" sizes="auto, (max-width: 358px) 100vw, 358px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="803" height="130" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-37.png" alt="" class="wp-image-409" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-37.png 803w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-37-300x49.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-37-768x124.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-37-660x107.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-37-500x81.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-37-800x130.png 800w" sizes="auto, (max-width: 803px) 100vw, 803px" /></figure>



<p>在安装了OpenClaw的服务器上打开红框中的地址即可访问OpenClaw的webUI页面</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="839" height="661" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-38.png" alt="" class="wp-image-410" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-38.png 839w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-38-300x236.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-38-768x605.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-38-660x520.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-38-500x394.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-38-800x630.png 800w" sizes="auto, (max-width: 839px) 100vw, 839px" /></figure>



<pre class="wp-block-code"><code>执行命令：openclaw gateway</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="461" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-39-1024x461.png" alt="" class="wp-image-411" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-39-1024x461.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-39-300x135.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-39-768x346.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-39-1536x692.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-39-660x297.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-39-500x225.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-39-800x361.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-39-1280x577.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-39.png 1693w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="560" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-40-1024x560.png" alt="" class="wp-image-412" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-40-1024x560.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-40-300x164.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-40-768x420.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-40-1536x839.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-40-660x361.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-40-500x273.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-40-800x437.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-40-1280x700.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-40.png 1914w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>频道中显示飞书</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="826" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-41-1024x826.png" alt="" class="wp-image-413" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-41-1024x826.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-41-300x242.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-41-768x620.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-41-660x533.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-41-500x404.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-41-800x646.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-41.png 1057w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>代理中显示minimax，则执行成功</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="538" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-42-1024x538.png" alt="" class="wp-image-414" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-42-1024x538.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-42-300x158.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-42-768x403.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-42-1536x807.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-42-660x347.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-42-380x200.png 380w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-42-500x263.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-42-800x420.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-42-1280x672.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-42.png 1910w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>至此安装配置完成</p>



<h2 class="wp-block-heading">安装技能（skills）</h2>



<p><a href="https://clawhub.ai/skills?sort=downloads">https://clawhub.ai/skills?sort=downloads</a></p>



<p>进入这个链接，里面为技能库，可以在这里挑选自己所需要的技能</p>



<p>例如：</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="737" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-61-1024x737.png" alt="" class="wp-image-441" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-61-1024x737.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-61-300x216.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-61-768x553.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-61-660x475.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-61-500x360.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-61-800x576.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-61.png 1095w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="640" height="365" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-63.png" alt="" class="wp-image-443" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-63.png 640w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-63-300x171.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-63-500x285.png 500w" sizes="auto, (max-width: 640px) 100vw, 640px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="430" height="319" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-64.png" alt="" class="wp-image-444" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-64.png 430w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-64-300x223.png 300w" sizes="auto, (max-width: 430px) 100vw, 430px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lhyshome.com/2026/03/11/389/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">389</post-id>	</item>
		<item>
		<title>iStoreOS的openclash，TUN 接口启动失败</title>
		<link>https://blog.lhyshome.com/2026/03/08/366/</link>
					<comments>https://blog.lhyshome.com/2026/03/08/366/#respond</comments>
		
		<dc:creator><![CDATA[lhy]]></dc:creator>
		<pubDate>Sat, 07 Mar 2026 17:46:55 +0000</pubDate>
				<category><![CDATA[小技巧]]></category>
		<category><![CDATA[iStoreOs]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[openClash]]></category>
		<guid isPermaLink="false">https://blog.lhyshome.com/?p=366</guid>

					<description><![CDATA[问题 iStoreOS的openclash，运行模式选择“TUN”或者“混合”时，提示：警告：TUN 接口启动… <span class="read-more"><a href="https://blog.lhyshome.com/2026/03/08/366/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">问题</h2>



<p>iStoreOS的openclash，运行模式选择“TUN”或者“混合”时，提示：警告：TUN 接口启动失败，尝试重启内核…，导致openclash一直重启，内网以旁路由为网关的虚拟机和服务，访问互联网和外网都出现了无法打开的情况。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="514" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-9-1024x514.png" alt="" class="wp-image-367" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-9-1024x514.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-9-300x151.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-9-768x385.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-9-1536x771.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-9-660x331.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-9-500x251.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-9-800x402.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-9-1280x642.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-9.png 1556w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>访问各大大模型无果后，百度搜索关键字，发现github上已有相关问题处理</p>



<p>地址为：<a href="https://github.com/vernesong/OpenClash/issues/4492">https://github.com/vernesong/OpenClash/issues/4492</a></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1009" height="315" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-10.png" alt="" class="wp-image-368" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-10.png 1009w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-10-300x94.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-10-768x240.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-10-660x206.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-10-500x156.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-10-800x250.png 800w" sizes="auto, (max-width: 1009px) 100vw, 1009px" /></figure>



<p>使用如上图方法处理成功。</p>



<h2 class="wp-block-heading">处理步骤</h2>



<p>执行 “ip link show”命令，如下图发现error</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="787" height="524" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-12.png" alt="" class="wp-image-370" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-12.png 787w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-12-300x200.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-12-768x511.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-12-660x439.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-12-500x333.png 500w" sizes="auto, (max-width: 787px) 100vw, 787px" /></figure>



<p>在系统->杂项设置 中，将镜像服务器选择如下图所示。（如果不选，则影响opkg update执行）</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="743" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-11-1024x743.png" alt="" class="wp-image-369" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-11-1024x743.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-11-300x218.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-11-768x557.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-11-660x479.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-11-500x363.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-11-800x580.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-11.png 1154w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>选择镜像源后依次执行</p>



<p>opkg update</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="521" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-13-1024x521.png" alt="" class="wp-image-371" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-13-1024x521.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-13-300x153.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-13-768x391.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-13-660x336.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-13-500x254.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-13-800x407.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-13.png 1178w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>opkg install &#8211;force-reinstall ip-full</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="971" height="101" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-14.png" alt="" class="wp-image-372" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-14.png 971w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-14-300x31.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-14-768x80.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-14-660x69.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-14-500x52.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-14-800x83.png 800w" sizes="auto, (max-width: 971px) 100vw, 971px" /></figure>



<p>如上两图，控制台中未见明确error相关字眼为成功</p>



<p>重新执行“ip link show”命令，如下图为成功</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="576" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-15-1024x576.png" alt="" class="wp-image-373" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-15-1024x576.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-15-300x169.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-15-768x432.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-15-660x371.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-15-500x281.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-15-800x450.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-15.png 1101w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>重启openclash后日志显示成功，测试成功</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="292" src="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-16-1024x292.png" alt="" class="wp-image-374" srcset="https://blog.lhyshome.com/wp-content/uploads/2026/03/image-16-1024x292.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-16-300x86.png 300w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-16-768x219.png 768w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-16-660x188.png 660w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-16-500x143.png 500w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-16-800x228.png 800w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-16-1280x365.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2026/03/image-16.png 1408w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lhyshome.com/2026/03/08/366/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">366</post-id>	</item>
		<item>
		<title>系统代理排除内网ip</title>
		<link>https://blog.lhyshome.com/2025/06/11/301/</link>
					<comments>https://blog.lhyshome.com/2025/06/11/301/#respond</comments>
		
		<dc:creator><![CDATA[lhy]]></dc:creator>
		<pubDate>Wed, 11 Jun 2025 01:39:41 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[小技巧]]></category>
		<category><![CDATA[脚本]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[常用命令]]></category>
		<guid isPermaLink="false">https://blog.lhyshome.com/?p=301</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code>localhost;127.<em>;10.</em>;172.16.<em>;172.17.</em>;172.18.<em>;172.19.</em>;172.20.<em>;172.21.</em>;172.22.<em>;172.23.</em>;172.24.<em>;172.25.</em>;172.26.<em>;172.27.</em>;172.28.<em>;172.29.</em>;172.30.<em>;172.31.</em>;192.168.*</code></pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lhyshome.com/2025/06/11/301/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">301</post-id>	</item>
		<item>
		<title>prometheus部署</title>
		<link>https://blog.lhyshome.com/2025/04/22/294/</link>
					<comments>https://blog.lhyshome.com/2025/04/22/294/#respond</comments>
		
		<dc:creator><![CDATA[lhy]]></dc:creator>
		<pubDate>Tue, 22 Apr 2025 03:23:57 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[脚本]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[grafana]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[prometheus]]></category>
		<guid isPermaLink="false">https://blog.lhyshome.com/?p=294</guid>

					<description><![CDATA[prometheus docker部署 prometheus.yml 配置文件 grafana docker部… <span class="read-more"><a href="https://blog.lhyshome.com/2025/04/22/294/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">prometheus docker部署</h2>



<pre class="wp-block-code"><code>docker run -d \
--name=prometheus \
-p 9090:9090 \
-v /home/prometheus/config/prometheus.yml:/etc/prometheus/prometheus.yml \
-v /home/prometheus/prometheus:/prometheus \
{harborPath}/prom/prometheus:v3.3.0</code></pre>



<h3 class="wp-block-heading">prometheus.yml 配置文件</h3>



<pre class="wp-block-code"><code># my global config
global:
  scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
    - static_configs:
        - targets:
          # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=&lt;job_name>` to any timeseries scraped from this config.
  - job_name: "prometheus"

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
      - targets: &#91;"{prometheus.path}"]
       # The label name is added as a label `label_name=&lt;label_value>` to any timeseries scraped from this config.
        labels:
          app: "prometheus"

  - job_name: 'Aserver'
    static_configs:
      - targets: &#91; '{Aserver.path}' ]
        labels:
          app: "Aserver"
  - job_name: 'Bserver'
    static_configs:
      - targets: &#91; '{Bserver.path}' ]
        labels:
          app: "Bserver"

  - job_name: '200mysql'
    static_configs:
      - targets: &#91;'{mysql.path}']
        labels:
          instance: "200mysql"
          app: "200mysql"</code></pre>



<h2 class="wp-block-heading">grafana docker部署</h2>



<pre class="wp-block-code"><code>docker run -d \
--name=grafana \
-p 3000:3000 \
-v /home/grafana/grafana:/var/lib/grafana \
-e "GF_SECURITY_ADMIN_PASSWORD={password}" \
{harborPath}/grafana/grafana:11.6.0</code></pre>



<h2 class="wp-block-heading">服务器监控收集器 docker部署</h2>



<pre class="wp-block-code"><code>docker run -d \
--name 200-exporter \
--restart=always \
-p 9100:9100 \
-v /proc:/host/proc:ro \
-v /sys:/host/sys:ro \
-v /:/rootfs:ro \
{harborPath}/prom/node-exporter:241003</code></pre>



<h2 class="wp-block-heading">mysql监控收集器 docker部署</h2>



<pre class="wp-block-code"><code>docker run -d \
-p 9104:9104 \
--name=mysqld-exporter \
-v /home/prometheus/mysql/.my.cnf:/.my.cnf \
{harborPath}/prom/mysqld-exporter:v0.17.2</code></pre>



<h3 class="wp-block-heading">.my.cnf 配置文件</h3>



<pre class="wp-block-code"><code>&#91;client]
user={mysql.user}
password={mysql.password}
host={mysql.host}
port={mysql.port}</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lhyshome.com/2025/04/22/294/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">294</post-id>	</item>
		<item>
		<title>查看指定位置多日志文件，根据关键字符检索</title>
		<link>https://blog.lhyshome.com/2025/04/02/287/</link>
					<comments>https://blog.lhyshome.com/2025/04/02/287/#respond</comments>
		
		<dc:creator><![CDATA[lhy]]></dc:creator>
		<pubDate>Wed, 02 Apr 2025 06:14:44 +0000</pubDate>
				<category><![CDATA[java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[小技巧]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[windows]]></category>
		<guid isPermaLink="false">https://blog.lhyshome.com/?p=287</guid>

					<description><![CDATA[windows 在powershell中查看 D:\tmp\txtSplit下所有.txt格式文件中，“htt… <span class="read-more"><a href="https://blog.lhyshome.com/2025/04/02/287/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">windows</h2>



<p><strong>在powershell中查看 D:\tmp\txtSplit下所有.txt格式文件中，“httpClientResult&#8211;nat result,”这个字符的相关信息，<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">输出在命令行中</mark></strong></p>



<pre class="wp-block-code"><code>Get-ChildItem "D:\tmp\txtSplit\**.txt" | Select-String "httpClientResult--nat result," | ForEach-Object {
Write-Host "文件: $($_.Path)"
Write-Host "行号: $($_.LineNumber)"
Write-Host "内容: $($_.Line)"
Write-Host "-----------------------"
}</code></pre>



<p><strong>在powershell中查看 D:\tmp\txtSplit下所有.txt格式文件中，“httpClientResult&#8211;nat result,”这个字符的相关信息，<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">输出在指定文件中</mark></strong></p>



<pre class="wp-block-code"><code>Get-ChildItem "D:\tmp\resource_collect*.log" |
Select-String "pool-23-thread-2" |
ForEach-Object {
"文件: $($_.Path)"
"行号: $($_.LineNumber)"
"内容: $($_.Line)"
"-----------------------"
} |
Out-File -FilePath "D:\tmp\monitor_collect_output.txt" -Encoding UTF8</code></pre>



<h2 class="wp-block-heading">Linux</h2>



<pre class="wp-block-code"><code>grep -rn 'ResourceFlavorStatistics.batchSave.resourceStatisticList.all:' ./</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lhyshome.com/2025/04/02/287/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">287</post-id>	</item>
		<item>
		<title>docker创建proxy-client镜像（设置 -e 参数配置）</title>
		<link>https://blog.lhyshome.com/2024/12/30/257/</link>
					<comments>https://blog.lhyshome.com/2024/12/30/257/#respond</comments>
		
		<dc:creator><![CDATA[lhy]]></dc:creator>
		<pubDate>Mon, 30 Dec 2024 03:04:33 +0000</pubDate>
				<category><![CDATA[java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[小技巧]]></category>
		<category><![CDATA[脚本]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[harbor]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[proxy-client]]></category>
		<category><![CDATA[内网穿透]]></category>
		<guid isPermaLink="false">https://blog.lhyshome.com/?p=257</guid>

					<description><![CDATA[文件夹目录 dockerFile ep.sh config.template docker构建及上传 进入pr… <span class="read-more"><a href="https://blog.lhyshome.com/2024/12/30/257/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">文件夹目录</h2>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="321" height="392" src="https://blog.lhyshome.com/wp-content/uploads/2024/12/image-2.png" alt="" class="wp-image-259" srcset="https://blog.lhyshome.com/wp-content/uploads/2024/12/image-2.png 321w, https://blog.lhyshome.com/wp-content/uploads/2024/12/image-2-246x300.png 246w" sizes="auto, (max-width: 321px) 100vw, 321px" /></figure>



<h2 class="wp-block-heading">dockerFile</h2>



<pre class="wp-block-code"><code>FROM {harbor}/test/openjdk:8-jre
LABEL authors="lhyshome_pc"
ENV TZ=Asia/Shanghai
ADD ./proxy-client /proxy-client
ADD ./ep.sh /ep.sh
RUN apt-get update &amp;&amp; apt-get install -y procps
RUN apt-get update &amp;&amp; apt-get install -y dos2unix
RUN dos2unix /ep.sh &amp;&amp; chmod +x /ep.sh
ENTRYPOINT &#91;"/ep.sh"]</code></pre>



<h2 class="wp-block-heading">ep.sh </h2>



<pre class="wp-block-code"><code>#!/bin/bash

echo "entrypoint.sh start"
# 定义目标配置文件路径
CONFIG_FILE=proxy-client/conf/config.properties

# 替换占位符为环境变量的值
sed -e "s|{{CLIENT_KEY}}|${CLIENT_KEY:-CLIENT_KEY}|g" \
    -e "s|{{SERVER_HOST}}|${SERVER_HOST:-127.0.0.1}|g" \
    -e "s|{{SERVER_PORT}}|${SERVER_PORT:-80}|g" \
    proxy-client/conf/config.template > $CONFIG_FILE

echo "Generated config file:"
cat $CONFIG_FILE

# 启动主程序（根据需要替换为实际启动命令）
exec "proxy-client/bin/startup.sh"</code></pre>



<h2 class="wp-block-heading">config.template</h2>



<pre class="wp-block-code"><code>client.key={{CLIENT_KEY}}
server.host={{SERVER_HOST}}
server.port={{SERVER_PORT}}</code></pre>



<h2 class="wp-block-heading">docker构建及上传</h2>



<p>进入proxy-client的上级目录</p>



<pre class="wp-block-code"><code>docker build -t {harbor}/test/proxy-client:v1.0.0 ./
docker push {harbor}/test/proxy-client:v1.0.0
docker image rm {harbor}/test/proxy-client:v1.0.0</code></pre>



<h2 class="wp-block-heading">docker部署命令</h2>



<p>docker run -e CLIENT_KEY=xxxxx -e SERVER_HOST=xxx.xxx.xxx.xxx -e SERVER_PORT=xxxx &#8211;name proxy-client &#8211;privileged=true &#8211;restart=always -d {harbor}/test/proxy-client:v1.0.0</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lhyshome.com/2024/12/30/257/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">257</post-id>	</item>
		<item>
		<title>Linux配置代理</title>
		<link>https://blog.lhyshome.com/2024/12/23/250/</link>
					<comments>https://blog.lhyshome.com/2024/12/23/250/#respond</comments>
		
		<dc:creator><![CDATA[lhy]]></dc:creator>
		<pubDate>Mon, 23 Dec 2024 07:46:21 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[小技巧]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://blog.lhyshome.com/?p=250</guid>

					<description><![CDATA[命令行配置代理 配置环境变量 在命令行工具中使用代理，需要在环境变量中明确指定。 配置步骤： 编辑环境变量文件… <span class="read-more"><a href="https://blog.lhyshome.com/2024/12/23/250/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">命令行配置代理</h2>



<h3 class="wp-block-heading"><strong>配置环境变量</strong></h3>



<p>在命令行工具中使用代理，需要在环境变量中明确指定。</p>



<h3 class="wp-block-heading">配置步骤：</h3>



<h3 class="wp-block-heading"><strong>编辑环境变量文件</strong> </h3>



<p>打开当前用户的 <code>~/.bashrc</code> 文件：</p>



<pre class="wp-block-code"><code><code>nano ~/.bashrc</code></code></pre>



<h3 class="wp-block-heading"><strong>添加代理环境变量</strong> </h3>



<p>根据代理类型（HTTP/HTTPS/FTP），添加以下内容：</p>



<pre class="wp-block-code"><code>export http_proxy=http://proxy.example.com:8080 
export https_proxy=http://proxy.example.com:8080 
export ftp_proxy=http://proxy.example.com:8080 
<code>export no_proxy=localhost,127.0.0.1,::1 </code></code></pre>



<p>如果代理需要认证，则添加用户名和密码：</p>



<pre class="wp-block-code"><code><code>export http_proxy=http://username:password@proxy.example.com:8080 </code>export https_proxy=http://username:password@proxy.example.com:8080</code></pre>



<h3 class="wp-block-heading"><strong>刷新环境变量</strong> </h3>



<p>保存文件后，运行以下命令使配置生效：</p>



<pre class="wp-block-code"><code><code>source ~/.bashrc</code></code></pre>



<h3 class="wp-block-heading">验证配置 </h3>



<p>查看环境变量是否已生效：</p>



<pre class="wp-block-code"><code><code>echo $http_proxy</code></code></pre>



<h2 class="wp-block-heading">Docker 客户端配置代理</h2>



<h3 class="wp-block-heading">前提</h3>



<p>Error response from daemon: Get &#8220;https://registry-1.docker.io/v2/&#8221;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="86" src="https://blog.lhyshome.com/wp-content/uploads/2024/12/image-1024x86.png" alt="" class="wp-image-251" srcset="https://blog.lhyshome.com/wp-content/uploads/2024/12/image-1024x86.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2024/12/image-300x25.png 300w, https://blog.lhyshome.com/wp-content/uploads/2024/12/image-768x65.png 768w, https://blog.lhyshome.com/wp-content/uploads/2024/12/image-500x42.png 500w, https://blog.lhyshome.com/wp-content/uploads/2024/12/image-800x67.png 800w, https://blog.lhyshome.com/wp-content/uploads/2024/12/image-1280x108.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2024/12/image-660x55.png 660w, https://blog.lhyshome.com/wp-content/uploads/2024/12/image.png 1381w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>因为没有代理，所以docker客户端无法访问dockerhub的默认仓库 https://registry-1.docker.io/v2/ 地址</p>



<h3 class="wp-block-heading"><strong>配置代理</strong></h3>



<p>如果您的网络需要通过代理访问外网，您需要在 Docker 中配置代理。</p>



<h4 class="wp-block-heading">配置步骤：</h4>



<h5 class="wp-block-heading"><strong>创建 Docker 配置目录（如果不存在）：</strong></h5>



<pre class="wp-block-code"><code>mkdir -p /etc/systemd/system/docker.service.d</code></pre>



<h5 class="wp-block-heading"><strong>创建或编辑 <code>http-proxy.conf</code> 文件：</strong></h5>



<pre class="wp-block-code"><code>nano /etc/systemd/system/docker.service.d/http-proxy.conf</code></pre>



<h5 class="wp-block-heading"><strong>添加以下内容：</strong> </h5>



<pre class="wp-block-code"><code># 根据实际代理信息替换 <span style="background-color: initial; font-family: inherit; font-size: inherit; color: initial;">http://proxy.example.com:8080 </span>
<code>Environment="HTTP_PROXY=http://proxy.example.com:8080" Environment="HTTPS_PROXY=http://proxy.example.com:8080" Environment="NO_PROXY=localhost,127.0.0.1"</code></code></pre>



<h5 class="wp-block-heading"><strong>重载并重启 Docker 服务：</strong></h5>



<pre class="wp-block-code"><code>systemctl daemon-reload
systemctl restart docker</code></pre>



<h5 class="wp-block-heading"><strong>验证代理配置是否生效：</strong></h5>



<pre class="wp-block-code"><code><code>docker info | grep -i proxy</code></code></pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lhyshome.com/2024/12/23/250/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">250</post-id>	</item>
		<item>
		<title>基于kkFileView的文件预览，docker部署</title>
		<link>https://blog.lhyshome.com/2024/08/15/209/</link>
					<comments>https://blog.lhyshome.com/2024/08/15/209/#respond</comments>
		
		<dc:creator><![CDATA[lhy]]></dc:creator>
		<pubDate>Thu, 15 Aug 2024 02:53:14 +0000</pubDate>
				<category><![CDATA[java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[小技巧]]></category>
		<category><![CDATA[脚本]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[kkFileView]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://blog.lhyshome.com/?p=209</guid>

					<description><![CDATA[下载 github下载地址：https://github.com/kekingcn/kkFileView 下载… <span class="read-more"><a href="https://blog.lhyshome.com/2024/08/15/209/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">下载</h2>



<p>github下载地址：<br>https://github.com/kekingcn/kkFileView</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="543" src="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-1024x543.png" alt="" class="wp-image-210" srcset="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-1024x543.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-300x159.png 300w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-768x407.png 768w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-1536x815.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-500x265.png 500w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-800x424.png 800w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-1280x679.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-660x350.png 660w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1.png 1587w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>下载源码的zip包</p>



<h2 class="wp-block-heading">安装</h2>



<p>将下载的源码打开后，将源码docker路径下的文件夹上传至服务器</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="391" height="592" src="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-2.png" alt="" class="wp-image-211" srcset="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-2.png 391w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-2-198x300.png 198w" sizes="auto, (max-width: 391px) 100vw, 391px" /></figure>



<p>在服务器执行docker build ../../Dockerfile 构建kkFileView的运行的基板</p>



<p>对源码 maven package后将server/target下的 kkFileView-4.4.0-beta.tar.gz 文件和根目录的Dockerfile（注意这里的Dockerfile和之前步骤的Dockerfile不是同一个，作用也不一样）上传至服务器</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="330" height="646" src="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-3.png" alt="" class="wp-image-212" srcset="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-3.png 330w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-3-153x300.png 153w" sizes="auto, (max-width: 330px) 100vw, 330px" /></figure>



<p>修改Dockerfile中的 ADD ./kkFileView-4.4.0-beta.tar.gz /opt/ 这一行  将kkFileView-4.4.0-beta.tar.gz的路径改为服务器上对应的 绝对路径或者相对路径，对当前DockerFile执行docker build ，构建完成后将会出现kkFileView的执行docker镜像</p>



<p>用docker run启动当前镜像 暴露8012端口到宿主机</p>



<p>在服务器防火墙上对8012端口放行</p>



<h2 class="wp-block-heading">验证</h2>



<p>http://服务器ip:8012</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="596" src="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-1024x596.png" alt="" class="wp-image-213" srcset="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-1024x596.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-300x175.png 300w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-768x447.png 768w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-500x291.png 500w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-800x466.png 800w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-1280x745.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-660x384.png 660w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4.png 1522w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>出现这个页面则为部署成功</p>



<p>http://服务器ip:8012/onlinePreview?url=aHR0cDovLzE5Mi4xNjguMC4yMDA6NTI0NC9wL0Rvd25sb2Fkcy8lRTYlOTYlQjAlRTUlQkIlQkElRTYlOTYlODclRTYlQTElQTMuZG9jeD9zaWduPW53RHB2MVhoS2NXQ3pPODVfa2tPbE85MFo1NGp2YnNXdXA0VlRacnlmaUU9OjA%3D</p>



<p><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">注意http://服务器ip:8012/onlinePreview?url= 后拼接的地址为文件下载地址，且必须经过base64编码后的请求地址</mark></p>



<h2 class="wp-block-heading">官方操作文档</h2>



<p>https://kkfileview.keking.cn</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lhyshome.com/2024/08/15/209/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">209</post-id>	</item>
	</channel>
</rss>
