<?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; Simon</title>
	<atom:link href="https://www.luisimon.com/category/linux_diary/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.luisimon.com</link>
	<description>blog</description>
	<lastBuildDate>Sun, 22 Jun 2025 11:52:10 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>

<image>
	<url>https://www.luisimon.com/wp-content/uploads/2019/09/cbrks-x5t4i-001.ico</url>
	<title>Linux日记 &#8211; Simon</title>
	<link>https://www.luisimon.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Ubuntu 24 强制设置root用户为简单密码</title>
		<link>https://www.luisimon.com/2025/06/22/949/</link>
		
		<dc:creator><![CDATA[Alan]]></dc:creator>
		<pubDate>Sun, 22 Jun 2025 11:52:09 +0000</pubDate>
				<category><![CDATA[Linux日记]]></category>
		<category><![CDATA[随手记录]]></category>
		<guid isPermaLink="false">https://www.luisimon.com/?p=949</guid>

					<description><![CDATA[以下脚本由ChatGPT生成，只要修改[NEW_PASSWORD]变量即可修改root用户密码为任意值。 使用 ... <a title="Ubuntu 24 强制设置root用户为简单密码" class="read-more" href="https://www.luisimon.com/2025/06/22/949/" aria-label="继续阅读Ubuntu 24 强制设置root用户为简单密码">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<p>以下脚本由ChatGPT生成，只要修改[<strong>NEW_PASSWORD</strong>]变量即可修改root用户密码为任意值。</p>



<p></p>



<pre class="wp-block-code"><code>

#!/bin/bash

# 你想设置的密码
NEW_PASSWORD="111111"

# 检查是否为 root 运行
if &#91;&#91; "$EUID" -ne 0 ]]; then
  echo "请以 root 身份运行本脚本（sudo）"
  exit 1
fi

# 确保 root 用户未被锁定
passwd -S root | grep -q 'L' &amp;&amp; {
  echo "解锁 root 用户..."
  passwd -u root
}

# 设置 root 密码（绕过复杂度检查）
echo "root:$NEW_PASSWORD" | chpasswd &amp;&amp; {
  echo "✅ 成功将 root 密码设置为 '$NEW_PASSWORD'"
} || {
  echo "❌ 设置密码失败"
  exit 1
}
</code></pre>



<p>使用比如vim编辑器新建一个脚本文件。</p>



<p>如果没有vim，请执行以下安装命令</p>



<pre class="wp-block-code"><code>#系统中无vim时执行
apt install vim</code></pre>



<pre class="wp-block-code"><code>vim set-root-simple-password.sh
# 然后按键盘上&#91;Insert]按键或者&#91;i]按键
# Shift + Insert，粘贴上面的脚本
# 按&#91;Esc]推出输入状态，在按&#91;:]冒号（注意是英文符号），终端窗口左下角会显示冒号，然后输入wq，回车即可保存。
# 下面命令给予脚本执行权限，并且执行脚本
chmod +a set-root-simple-password.sh &amp; ./set-root-simple-password.sh</code></pre>



<p><strong>注意Ubuntu桌面不允许使用root登录，所以切换到root登录时，无论如何都提示密码错误！</strong></p>



<p>允许root登录桌面另有办法，请自行AI。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>WinSCP和SecureCRT开启心跳，保持连接</title>
		<link>https://www.luisimon.com/2024/09/08/912/</link>
		
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Sun, 08 Sep 2024 05:08:19 +0000</pubDate>
				<category><![CDATA[Linux日记]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Putty]]></category>
		<category><![CDATA[SecureCRT]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[TCP]]></category>
		<category><![CDATA[WinSCP]]></category>
		<category><![CDATA[心跳]]></category>
		<category><![CDATA[断线]]></category>
		<category><![CDATA[断连]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[运维]]></category>
		<guid isPermaLink="false">https://www.luisimon.com/?p=912</guid>

					<description><![CDATA[WinSCP和SecureCRT是服务器运维人员常用的两个软件工具，用于连接登录Linux服务器。但是，在连接 ... <a title="WinSCP和SecureCRT开启心跳，保持连接" class="read-more" href="https://www.luisimon.com/2024/09/08/912/" aria-label="继续阅读WinSCP和SecureCRT开启心跳，保持连接">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<p>WinSCP和SecureCRT是服务器运维人员常用的两个软件工具，用于连接登录Linux服务器。但是，在连接公网的服务器时，如果比较长时间不操作，电信运营商会丢弃长时间没有没有数据传输的TCP连接，这样会导致我们需要频繁重新登录服务器。</p>



<p></p>



<p class="has-medium-font-size"><strong>WinSCP设置心跳</strong></p>



<p>在登录窗口选择你要设置心跳的服务器，点击【编辑】</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="640" height="430" src="https://www.luisimon.com/wp-content/uploads/2024/09/微信图片_20240908123847.png" alt="" class="wp-image-913" srcset="https://www.luisimon.com/wp-content/uploads/2024/09/微信图片_20240908123847.png 640w, https://www.luisimon.com/wp-content/uploads/2024/09/微信图片_20240908123847-300x202.png 300w" sizes="(max-width: 640px) 100vw, 640px" /></figure>



<p>然后点击【高级】</p>



<figure class="wp-block-image size-full"><img decoding="async" width="640" height="430" src="https://www.luisimon.com/wp-content/uploads/2024/09/微信图片_20240908123902.png" alt="" class="wp-image-914" srcset="https://www.luisimon.com/wp-content/uploads/2024/09/微信图片_20240908123902.png 640w, https://www.luisimon.com/wp-content/uploads/2024/09/微信图片_20240908123902-300x202.png 300w" sizes="(max-width: 640px) 100vw, 640px" /></figure>



<p>选择【连接】设置，如下图开启【Keeplives】</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="567" height="461" src="https://www.luisimon.com/wp-content/uploads/2024/09/微信图片_20240908123908.png" alt="" class="wp-image-915" style="width:647px;height:auto" srcset="https://www.luisimon.com/wp-content/uploads/2024/09/微信图片_20240908123908.png 567w, https://www.luisimon.com/wp-content/uploads/2024/09/微信图片_20240908123908-300x244.png 300w" sizes="(max-width: 567px) 100vw, 567px" /></figure>



<p></p>



<p class="has-medium-font-size"><strong>SecureCRT设置心跳</strong></p>



<p>选择要设置心跳的服务器，右键菜单点击【Properties】(属性)</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="376" height="354" src="https://www.luisimon.com/wp-content/uploads/2024/09/Screenshot-2024-09-08-125053.png" alt="" class="wp-image-916" style="width:644px;height:auto" srcset="https://www.luisimon.com/wp-content/uploads/2024/09/Screenshot-2024-09-08-125053.png 376w, https://www.luisimon.com/wp-content/uploads/2024/09/Screenshot-2024-09-08-125053-300x282.png 300w" sizes="auto, (max-width: 376px) 100vw, 376px" /></figure>



<p>选择【Terminal】(终端)设置，开启【Send Protocol NO-OP】，时间间隔一般设置30秒</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="543" height="512" src="https://www.luisimon.com/wp-content/uploads/2024/09/微信图片_20240908125711.png" alt="" class="wp-image-917" style="width:659px;height:auto" srcset="https://www.luisimon.com/wp-content/uploads/2024/09/微信图片_20240908125711.png 543w, https://www.luisimon.com/wp-content/uploads/2024/09/微信图片_20240908125711-300x283.png 300w" sizes="auto, (max-width: 543px) 100vw, 543px" /></figure>



<p></p>



<p>这样设置后就可以很大程度避免断线的问题啦</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>TrueNAS Scale系统开启Wake On Lan（网络唤醒）功能（教程）</title>
		<link>https://www.luisimon.com/2023/07/16/727/</link>
		
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Sat, 15 Jul 2023 18:04:42 +0000</pubDate>
				<category><![CDATA[Linux日记]]></category>
		<category><![CDATA[极客记录]]></category>
		<category><![CDATA[FreeNAS]]></category>
		<category><![CDATA[TrueNAS]]></category>
		<category><![CDATA[WOL]]></category>
		<guid isPermaLink="false">https://www.luisimon.com/?p=727</guid>

					<description><![CDATA[Wake-on-LAN简称WOL或WoL，中文多译为“网路唤醒”、“远端唤醒”技术。WOL是一种技术，同时也是 ... <a title="TrueNAS Scale系统开启Wake On Lan（网络唤醒）功能（教程）" class="read-more" href="https://www.luisimon.com/2023/07/16/727/" aria-label="继续阅读TrueNAS Scale系统开启Wake On Lan（网络唤醒）功能（教程）">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<p><strong>Wake-on-LAN</strong>简称<strong>WOL</strong>或<strong>WoL</strong>，中文多译为“<strong>网路唤醒</strong>”、“<strong>远端唤醒</strong>”技术。WOL是一种技术，同时也是该技术的规范标准，它的功效在于让<a href="https://www.luisimon.com/goto/57h5" rel="nofollow">休眠</a>状态或<a href="https://www.luisimon.com/goto/csi9" rel="nofollow">关机</a>状态的电脑，透过<a href="https://www.luisimon.com/goto/jzy1" rel="nofollow">区域网路</a>的另一台电脑对其发令，使其唤醒、恢复成运作状态，或从关机状态转成<a href="https://www.luisimon.com/goto/gi4s" rel="nofollow">开机</a>状态。该消息通常由在连接到同一局域网的设备上执行的程序发送到目标计算机。也可以使用子网定向广播或 WoL 网关服务从另一个网络发起消息。<strong>——<em>维基百科</em></strong></p>



<p>我使用昂达的一款<strong>昂达B365CD4</strong>主板安装了TrueNAS Scale系统，出于节能减碳的需要，设置了晚上自动关机。清晨使用WOL唤醒机器。</p>



<p>开启WOL共功能</p>



<p>开机，在屏幕出现主板logo或者其他信息的时候按Del进入BIOS</p>



<p><strong>开启PXE功能</strong>，如下图，将<strong>Network Stack</strong>配置下的<strong>Ipv4 PXE Support</strong>设置为<strong>Enable</strong></p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://www.pomato.eu.org/img/20230715_102309-16893922115971.jpg" alt=""/></figure>



<p>开启网卡的WOL功能</p>



<pre class="wp-block-code"><code># 用以下命令查看网卡名称
ifconfig</code></pre>



<pre class="wp-block-code"><code># 添加WOL配置文件
# 这里的eth0需要跟wol唤醒网卡的名称
vim /etc/network/interfaces.d/eth0</code></pre>



<pre class="wp-block-code"><code># 配置文件内容
auto enp8s0
iface enp8s0 inet dhcp
    ethernet-wol g</code></pre>



<p><strong>重新系统后测试是否成功</strong></p>



<p><strong><em>注：如果网络唤醒失效，尝试重新保存eth0文件（猜测是重新保存才能令设置生效，从而系统会按当前设置去修改BIOS）。by Alan</em></strong></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Nginx流量转发配置（教程）</title>
		<link>https://www.luisimon.com/2022/03/18/597/</link>
		
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Fri, 18 Mar 2022 14:33:32 +0000</pubDate>
				<category><![CDATA[Linux日记]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[TCP]]></category>
		<category><![CDATA[web]]></category>
		<guid isPermaLink="false">https://www.luisimon.xyz/?p=597</guid>

					<description><![CDATA[yum install nginx -y 如果提示“No package nginx available.”则 ... <a title="Nginx流量转发配置（教程）" class="read-more" href="https://www.luisimon.com/2022/03/18/597/" aria-label="继续阅读Nginx流量转发配置（教程）">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<p><strong>yum install nginx -y</strong></p>



<p>如果提示“No package nginx available.”则执行以下安装，在重新执行上一句安装nginx</p>



<p><strong>yum install epel-release -y</strong></p>



<p>安装stream模块</p>



<p><strong>yum install nginx-mod-stream -y</strong></p>



<p>使用以下命令禁用（SELinux for NGINX）,否会出现监听端口失败</p>



<p><strong>semanage permissive -a httpd_t</strong></p>



<p>配置文件</p>



<p><strong>与http节点同级添加stream节点</strong>，如下</p>



<p><em>以下是格式例子</em></p>



<pre class="wp-block-code"><code>stream{
	upstream group_1151 {
		 hash $remote_addr consistent;
		 server www.yourserver.com:1151  max_fails=3 fail_timeout=10s;
	 }
	server {
	  listen 1151;
	  listen 1151 udp;
	  proxy_connect_timeout 20s;
	  proxy_timeout 5m;
	  proxy_pass group_1151;
	}
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
