<?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>System Log (系统日志) &#8211; Eternal Center</title>
	<atom:link href="https://eternalcenter-sep-2022.github.io/category/system/system-network-system-security-system-log/system-log/feed/" rel="self" type="application/rss+xml" />
	<link>https://eternalcenter-sep-2022.github.io/</link>
	<description></description>
	<lastBuildDate>Wed, 07 Sep 2022 07:38:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Linux 防范黑客入侵的思路</title>
		<link>https://eternalcenter-sep-2022.github.io/thoughts-on-preventing-hacker-intrusion-in-linux/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 28 Jul 2022 08:33:56 +0000</pubDate>
				<category><![CDATA[Articles (文章)]]></category>
		<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Creations (创作)]]></category>
		<category><![CDATA[Information Technology (IT) Articles (信息技术类文章)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System and System Software's Update and Patch (系统和系统软件的更新和补丁)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System Firewall (系统防火墙)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Port Security (系统端口安全)]]></category>
		<category><![CDATA[System Privilege Security (系统权限安全)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=27358</guid>

					<description><![CDATA[黑客发现阶段 黑客在入侵前往往会先对整个网络进行扫描，尝试发现我们的系统。在这个阶段我们可以尝试的防范措施有： 1) 关闭 ICMP 协议，让黑客无法通过 ping 发现我们的系统2) 关闭所有不需要的端口3) 通过防火墙只让允许访问的 IP 地址访问对应的端口4) 让防火墙使用 drop 操作丢掉所有没有被允许的访问请求 黑客列举阶段和黑客立足阶段 黑客在发现了我们的系统之后。会根据我们系统和软件的版本，列举不同的破解方法并进行取舍，并最终会选择一种或多种方法进行尝试。在这两个阶段我们可以尝试的防范措施有： 1) 不使用盗版的系统和软件2) 不使用有漏洞的系统和软件3) 尽量将所有的系统和软件升级到最新的版本4) 删除所有非必须的软件5) 在用户尝试登录系统时，取消显示系统的版本6) 删除或禁用所有不需要的用户7) 让所有的用户都使用复杂的密码8) 定期检查和修改所有用户的密码9) 定期检查和修改所有用户 ~/.ssh/ 目录中的密钥10) 限制错误密码尝试的次数，以防止暴力破解11) 定期检查系统防火墙策略12) 定期检查系统开启的所有端口13) 定期检查系统开启的所有进程14) 定期查看 /var/log/message 中的尝试登录失败的日志记录 黑客保持持久性阶段 黑客在成功进入系统以后，会尝试为自己下次进入系统准备方法，以让入侵保持持久性。在这个阶段我们可以尝试的防范措施有： 1) 定期检查系统中的所有用户的名称和数量2) 定期检查系统中所有拥有 root 权限的名称和数量3) 定期检查和修改所有用户的密码4) 定期检查和修改所有用户 ~/.ssh/ 目录中的密钥5) 定期检查系统防火墙策略6) 定期检查系统开启的所有端口7) 定期检查系统开启的所有进程8) 缩小重要文件的权限9) 定期检查所有用户的登录日志10) 通过 auditd 服务监控所有重要配置文件，并定期检查监控日志 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/thoughts-on-preventing-hacker-intrusion-in-linux/" class="more-link">Continue reading<span class="screen-reader-text"> "Linux 防范黑客入侵的思路"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>黑客发现阶段</h3>



<p>黑客在入侵前往往会先对整个网络进行扫描，尝试发现我们的系统。在这个阶段我们可以尝试的防范措施有：</p>



<p>1) 关闭 ICMP 协议，让黑客无法通过 ping 发现我们的系统<br>2) 关闭所有不需要的端口<br>3) 通过防火墙只让允许访问的 IP 地址访问对应的端口<br>4) 让防火墙使用 drop 操作丢掉所有没有被允许的访问请求</p>



<h3>黑客列举阶段和黑客立足阶段</h3>



<p>黑客在发现了我们的系统之后。会根据我们系统和软件的版本，列举不同的破解方法并进行取舍，并最终会选择一种或多种方法进行尝试。在这两个阶段我们可以尝试的防范措施有：</p>



<p>1) 不使用盗版的系统和软件<br>2) 不使用有漏洞的系统和软件<br>3) 尽量将所有的系统和软件升级到最新的版本<br>4) 删除所有非必须的软件<br>5) 在用户尝试登录系统时，取消显示系统的版本<br>6) 删除或禁用所有不需要的用户<br>7) 让所有的用户都使用复杂的密码<br>8) 定期检查和修改所有用户的密码<br>9) 定期检查和修改所有用户 ~/.ssh/ 目录中的密钥<br>10) 限制错误密码尝试的次数，以防止暴力破解<br>11) 定期检查系统防火墙策略<br>12) 定期检查系统开启的所有端口<br>13) 定期检查系统开启的所有进程<br>14) 定期查看 /var/log/message 中的尝试登录失败的日志记录</p>



<h3>黑客保持持久性阶段</h3>



<p>黑客在成功进入系统以后，会尝试为自己下次进入系统准备方法，以让入侵保持持久性。在这个阶段我们可以尝试的防范措施有：</p>



<p>1) 定期检查系统中的所有用户的名称和数量<br>2) 定期检查系统中所有拥有 root 权限的名称和数量<br>3) 定期检查和修改所有用户的密码<br>4) 定期检查和修改所有用户 ~/.ssh/ 目录中的密钥<br>5) 定期检查系统防火墙策略<br>6) 定期检查系统开启的所有端口<br>7) 定期检查系统开启的所有进程<br>8) 缩小重要文件的权限<br>9) 定期检查所有用户的登录日志<br>10) 通过 auditd 服务监控所有重要配置文件，并定期检查监控日志</p>



<h3>黑客掩盖痕迹阶段</h3>



<p>黑客让入侵保持持久性后，会尝试掩盖自己的痕迹。在这个阶段我们可以尝试的防范措施有：</p>



<p>1) 定期检查系统中的所有用户的名称和数量<br>2) 定期检查系统中所有拥有 root 权限的名称和数量<br>3) 定期检查和修改所有用户的密码<br>4) 定期检查和修改所有用户 ~/.ssh/ 目录中的密钥<br>5) 定期检查系统防火墙策略<br>6) 定期检查系统开启的所有端口<br>7) 定期检查系统开启的所有进程<br>8) 缩小重要文件的权限<br>9) 定期检查所有用户的登录日志，注意日志的时间是否连贯<br>10) 通过 auditd 服务监控所有重要配置文件，并定期检查监控日志，注意日志的时间是否连贯</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] audit 常用的监控规则</title>
		<link>https://eternalcenter-sep-2022.github.io/common-monitoring-rules-of-audit/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 28 Jul 2022 06:22:23 +0000</pubDate>
				<category><![CDATA[AppArmor]]></category>
		<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[SELinux]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=27352</guid>

					<description><![CDATA[内容一：监控 SELinux 配置文件 1.1 在 audit 添加监控 SELinux 配置文件的规则 添加以下内容： 1.2 让添加的监控 SELinux 配置文件的规则生效 1.3 确认添加的监控 SELinux 配置文件的规则已生效 内容二：监控 AppArmor 配置文件 2.1 在 audit 添加监控 AppArmor 配置文件的规则 添加以下内容： 2.2 让添加的监控 AppArmor 配置文件的规则生效 2.3 确认添加的监控 AppArmor 配置文件的规则已生效]]></description>
										<content:encoded><![CDATA[
<h3>内容一：监控 SELinux 配置文件</h3>



<h4>1.1 在 audit 添加监控 SELinux 配置文件的规则</h4>



<pre class="wp-block-code"><code># vim /etc/audit/rules.d/audit.rules</code></pre>



<p>添加以下内容：</p>



<pre class="wp-block-code"><code>......
-w /etc/selinux/ -p wa -k MAC-policy
-w /usr/share/selinux/ -p wa -k MAC-policy</code></pre>



<h4>1.2 让添加的监控 SELinux 配置文件的规则生效</h4>



<pre class="wp-block-code"><code># service auditd restart</code></pre>



<h4>1.3 确认添加的监控 SELinux 配置文件的规则已生效</h4>



<pre class="wp-block-code"><code># auditctl -l | grep -i selinux</code></pre>



<h3>内容二：监控 AppArmor 配置文件</h3>



<h4>2.1 在 audit 添加监控 AppArmor 配置文件的规则</h4>



<pre class="wp-block-code"><code># vim /etc/audit/rules.d/audit.rules</code></pre>



<p>添加以下内容：</p>



<pre class="wp-block-code"><code>......
-w /etc/apparmor/ -p wa -k MAC-policy
-w /etc/apparmor.d/ -p wa -k MAC-policy</code></pre>



<h4>2.2 让添加的监控 AppArmor 配置文件的规则生效</h4>



<pre class="wp-block-code"><code># service auditd restart</code></pre>



<h4>2.3 确认添加的监控 AppArmor 配置文件的规则已生效</h4>



<pre class="wp-block-code"><code># auditctl -l | grep -i apparmor</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] audit 的设置 （日志保存时间）</title>
		<link>https://eternalcenter-sep-2022.github.io/audit-log-save-time/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 18 Jul 2022 01:45:08 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[Storage Service (存储服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Privilege Security (系统权限安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26972</guid>

					<description><![CDATA[方法一：通过 audit 配置文件设置 1.1 设置 audit 日志的保存时间 确保部分内容如下： （补充：这里以1) 开启 audit 日志 （local_events = yes） （write_logs = yes）2) 将 audit 日志写入 /var/log/audit/audit.log 文件 （log_file = /var/log/audit/audit.log）3) audit 日志每达到 8M 大小就将旧的 audit 日志进行备份并创建新的 audit 日志 （max_log_file = 8） （max_log_file_action = ROTATE），也可以修改成： max_log_file_action = keep_logs4) 旧的 audit 日志保存 5 份 （num_logs =5）为例） 1.2 让设置的 audit 时间生效 方法二：通过 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/audit-log-save-time/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] audit 的设置 （日志保存时间）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>方法一：通过 audit 配置文件设置</h3>



<h4>1.1 设置 audit 日志的保存时间</h4>



<pre class="wp-block-code"><code># vim /etc/audit/auditd.conf</code></pre>



<p>确保部分内容如下：</p>



<pre class="wp-block-code"><code>......
local_events = yes
......
write_logs = yes
......
log_file = /var/log/audit/audit.log
......
max_log_file = 8
......
num_logs =5
......
max_log_file_action = ROTATE
......</code></pre>



<p>（<br>补充：这里以<br>1) 开启 audit 日志 （local_events = yes） （write_logs = yes）<br>2) 将 audit 日志写入 /var/log/audit/audit.log 文件 （log_file = /var/log/audit/audit.log）<br>3) audit 日志每达到 8M 大小就将旧的 audit 日志进行备份并创建新的 audit 日志 （max_log_file = 8） （max_log_file_action = ROTATE），也可以修改成： max_log_file_action = keep_logs<br>4) 旧的 audit 日志保存 5 份 （num_logs =5）<br>为例<br>）</p>



<h4>1.2 让设置的 audit 时间生效</h4>



<pre class="wp-block-code"><code># service auditd restart</code></pre>



<h3>方法二：通过 logrotate 配置文件设置</h3>



<h4>2.1 设置 audit 日志的保存时间</h4>



<pre class="wp-block-code"><code># vim /etc/logrotate.d/auditd</code></pre>



<p>创建以下内容：</p>



<pre class="wp-block-code"><code>/var/log/audit/*
{
rotate 30
daily
missingok
compress
delaycompress
postrotate
touch /var/log/audit/audit.log ||:
chmod 0600 /var/log/audit/audit.log ||:
service auditd restart
endscript
}</code></pre>



<p>（<br>补充：这里以：<br>1) 备份的日志文件保留 30 份 （rotate 30）<br>2) 每天将现在的日志文件进行备份并生成新的日志文件 （dayly）<br>）</p>



<h4>2.2 让设置的 audit 时间生效</h4>



<pre class="wp-block-code"><code># systemctl restart logrotate.service</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] audit 日志时间格式的转换</title>
		<link>https://eternalcenter-sep-2022.github.io/time-format-conversion/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 07 Jul 2022 08:00:02 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[Storage Service (存储服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Privilege Security (系统权限安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26438</guid>

					<description><![CDATA[步骤一：创建用于 audit 转换日志时间格式的脚本 创建以下内容： （补充：这里以创建名为 time_format_conversion.pl 的用于转换 audit 日志时间格式的脚本为例） 步骤二：转换 audit 日志时间格式 或者： 或者： 或者： 或者： 或者： （补充：这里以使用名为 time_format_conversion.pl 的用于转换 audit 日志时间格式的脚本为例）]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：创建用于 audit 转换日志时间格式的脚本</h3>



<pre class="wp-block-code"><code># vim time_format_conversion.pl</code></pre>



<p>创建以下内容：</p>



<pre class="wp-block-code"><code>s/(1\d{9})/localtime($1)/e</code></pre>



<p>（补充：这里以创建名为 time_format_conversion.pl 的用于转换 audit 日志时间格式的脚本为例）</p>



<h3>步骤二：转换 audit 日志时间格式</h3>



<pre class="wp-block-code"><code># cat /var/log/audit/audit.log | perl -p time_format_conversion.pl</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># less /var/log/audit/audit.log | perl -p time_format_conversion.pl</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># more /var/log/audit/audit.log | perl -p time_format_conversion.pl</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># head /var/log/audit/audit.log | perl -p time_format_conversion.pl</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># tail /var/log/audit/audit.log | perl -p time_format_conversion.pl</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># tail -f /var/log/audit/audit.log | perl -p time_format_conversion.pl</code></pre>



<p>（补充：这里以使用名为 time_format_conversion.pl 的用于转换 audit 日志时间格式的脚本为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] 文件或目录的监控 （audit 版）</title>
		<link>https://eternalcenter-sep-2022.github.io/monitor-directory-file-audit/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 05 Jul 2022 10:18:15 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Privilege (系统权限)]]></category>
		<category><![CDATA[System Privilege Security (系统权限安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<category><![CDATA[System User & System Privilege (系统用户 & 系统权限)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26264</guid>

					<description><![CDATA[步骤一：使用 audit 监控文件或目录 1.1 在 audit 的策略里添加要监控的目录或文件 1.1.1 案例一：监控某个目录以及目录下的目录和文件 添加以下内容： （补充：这里以监控目录 /tmp 里的目录和文件为例） 1.1.2 案例二：监控某个文件 添加以下内容： （补充：这里以监控目录 /dev/null 文件为例） 1.2 让监控目录或文件的配置生效 步骤二：显示 audit 监控记录 （补充：记录里的1) nametype=CREATE 字段代表创建2) nametype=NORMAL 字段代表普通3) nametype=DELETE 字段代表删除） 或者： （补充：这里以显示文件被修改的记录为例）]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：使用 audit 监控文件或目录</h3>



<h4>1.1 在 audit 的策略里添加要监控的目录或文件</h4>



<h5>1.1.1 案例一：监控某个目录以及目录下的目录和文件</h5>



<pre class="wp-block-code"><code># vim /etc/audit/rules.d/audit.rules</code></pre>



<p>添加以下内容：</p>



<pre class="wp-block-code"><code>......
-a exit,always -F dir=/tmp -F perm=rwxa</code></pre>



<p>（补充：这里以监控目录 /tmp 里的目录和文件为例）</p>



<h5>1.1.2 案例二：监控某个文件</h5>



<pre class="wp-block-code"><code># vim /etc/audit/rules.d/audit.rules</code></pre>



<p>添加以下内容：</p>



<pre class="wp-block-code"><code>......
-a exit,always -S unlink -S unlinkat -S rmdir -S rename -S renameat -F path=/dev/null</code></pre>



<p>（补充：这里以监控目录 /dev/null 文件为例）</p>



<h4>1.2 让监控目录或文件的配置生效</h4>



<pre class="wp-block-code"><code># service auditd restart</code></pre>



<h3>步骤二：显示 audit 监控记录</h3>



<pre class="wp-block-code"><code># cat /var/log/audit</code></pre>



<p>（<br>补充：记录里的<br>1) nametype=CREATE 字段代表创建<br>2) nametype=NORMAL 字段代表普通<br>3) nametype=DELETE 字段代表删除<br>）</p>



<p>或者：</p>



<pre class="wp-block-code"><code># sudo ausearch -i -k user-modify</code></pre>



<p>（补充：这里以显示文件被修改的记录为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] wtmp 日志保存时间默认策略的设置 （设置 last 命令可以显示多久以前记录）</title>
		<link>https://eternalcenter-sep-2022.github.io/wtmp/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 17 Jun 2022 13:15:11 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=24466</guid>

					<description><![CDATA[如果是 Rocky Linux &#38; RHEL： （补充：1) 影响的日志文件有 /var/log/wtmp （/var/log/wtmp）2) 每月将现在的日志文件进行备份并生成新的日志文件 （monthly）3) 日志文件权限是 0644 所属主是 root （create 0664 root utmp）4) 只有当日志文件超过 1 M 时，且达到备份的时间才会开始备份5) 备份的日志文件保留 5 份 （rotate 1）） 如果是 openSUSE &#38; SLE： （补充：1) 影响的日志文件有 /var/log/wtmp 和 /var/log/btmp （/var/log/wtmp /var/log/btmp）2) 对备份的日志文件进行压缩 （compress）3) 将 YYYYMMDD 格式的时间作为备份日志文件名的一部分 （dateext）4) 日志最多保存 365 天 （maxage 365）5) 备份的日志文件保留 99 份 （rotate 99）6) &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/wtmp/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] wtmp 日志保存时间默认策略的设置 （设置 last 命令可以显示多久以前记录）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>如果是 Rocky Linux &amp; RHEL：</p>



<pre class="wp-block-code"><code># cat /etc/logrotate.conf
......
/var/log/wtmp {
    monthly
    create 0664 root utmp
        minsize 1M
    rotate 1
}
......</code></pre>



<p>（<br>补充：<br>1) 影响的日志文件有 /var/log/wtmp （/var/log/wtmp）<br>2) 每月将现在的日志文件进行备份并生成新的日志文件 （monthly）<br>3) 日志文件权限是 0644 所属主是 root （create 0664 root utmp）<br>4) 只有当日志文件超过 1 M 时，且达到备份的时间才会开始备份<br>5) 备份的日志文件保留 5 份 （rotate 1）<br>）</p>



<p>如果是 openSUSE &amp; SLE：</p>



<pre class="wp-block-code"><code># cat /etc/logrotate.d/wtmp
/var/log/wtmp /var/log/btmp {
    compress
    dateext
    maxage 365
    rotate 99
    size=+400k
    notifempty
    missingok
    copytruncate
}</code></pre>



<p>（<br>补充：<br>1) 影响的日志文件有 /var/log/wtmp 和 /var/log/btmp （/var/log/wtmp /var/log/btmp）<br>2) 对备份的日志文件进行压缩 （compress）<br>3) 将 YYYYMMDD 格式的时间作为备份日志文件名的一部分 （dateext）<br>4) 日志最多保存 365 天 （maxage 365）<br>5) 备份的日志文件保留 99 份 （rotate 99）<br>6) 现在的日志文件超过 400 k 就开始备份，不用考虑备份时间，且备份时间的相关设置也将无效 （size=+400k）<br>7) 如果现有日志文件是空文件，则不再对日志文件进行备份 （notifempty）<br>8) 如果现有日志文件丢失，则不报错直接生成新的日志文件 （missingok）<br>）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux sudo 日志的开启</title>
		<link>https://eternalcenter-sep-2022.github.io/sudo-log/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 17 Jun 2022 03:14:07 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Privilege (系统权限)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System User & System Privilege (系统用户 & 系统权限)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=24372</guid>

					<description><![CDATA[步骤一：开启 sudo 日志 或者： 添加以下内容： 步骤二：显示 sudo 日志 2.1 退出后重新登录 （步骤略） 2.2 显示 sudo 日志]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：开启 sudo 日志</h3>



<pre class="wp-block-code"><code># vim /etc/sudoers</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># visudo</code></pre>



<p>添加以下内容：</p>



<pre class="wp-block-code"><code>......
Defaults logfile="/var/log/sudo.log"</code></pre>



<h3>步骤二：显示 sudo 日志</h3>



<h4>2.1 退出后重新登录</h4>



<p>（步骤略）</p>



<h4>2.2 显示 sudo 日志</h4>



<pre class="wp-block-code"><code># cat /var/log/sudo.log</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 用户登录记录的显示</title>
		<link>https://eternalcenter-sep-2022.github.io/login-login-display/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 07 Jun 2022 08:28:00 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23713</guid>

					<description><![CDATA[方法一：使用 last 命令 方法二：查看系统日志 如果是 openSUSE &#38; SLE 将以下内容： （注意：必须在 /etc/ssh/sshd_config 配置文档里设置了 LogLevel INFO 参数和 SyslogFacility AUTH 参数以后此方法才会有效） 如果是 Rocky Linux &#38; CentOS Linux &#38; RHEL： 或者： （注意：必须在 /etc/ssh/sshd_config 配置文档里设置了 LogLevel INFO 参数和 SyslogFacility AUTH 参数以后此方法才会有效）]]></description>
										<content:encoded><![CDATA[
<h3>方法一：使用 last 命令</h3>



<pre class="wp-block-code"><code># last | grep pts</code></pre>



<h3>方法二：查看系统日志</h3>



<p>如果是 openSUSE &amp; SLE 将以下内容：</p>



<pre class="wp-block-code"><code># cat /var/log/messages | grep systemd-logind</code></pre>



<p>（注意：必须在 /etc/ssh/sshd_config 配置文档里设置了 LogLevel INFO 参数和 SyslogFacility AUTH 参数以后此方法才会有效）</p>



<p>如果是 Rocky Linux &amp; CentOS Linux &amp; RHEL：</p>



<pre class="wp-block-code"><code># cat /var/log/secure | grep systemd-logind</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># cat /var/log/messages | grep systemd-logind</code></pre>



<p>（注意：必须在 /etc/ssh/sshd_config 配置文档里设置了 LogLevel INFO 参数和 SyslogFacility AUTH 参数以后此方法才会有效）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux SNMPv3 客户端自查 （检查 SNMPv3 客户端是否能正常传输数据）</title>
		<link>https://eternalcenter-sep-2022.github.io/snmpv3-client-check/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 25 Apr 2022 07:04:26 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23261</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code># snmpwalk -v3 -u siemens -l authNoPriv -a MD5 -x DES -A '&lt;user&gt;' -X '&lt;password&gt;' localhost</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 常用日志 （openSUSE &#038; SUSE 版）</title>
		<link>https://eternalcenter-sep-2022.github.io/log-opensusesuse/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 07 Apr 2022 09:24:12 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<category><![CDATA[System Statistic Log (系统统计日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=22930</guid>

					<description><![CDATA[1) /var/log/boot.msg，包含系统启动时显示在屏幕上的信息（补充：当进入系统时，可以同时按下 “ctrl” 键和 “alt” 键和 “f10” 键切换到显示日志的界面，之后可以再通过 KVM 显示系统启动时显示在屏幕上的信息。）2) /var/log/boot.omsg，包含上一次系统启动时显示在屏幕上的信息3) /var/log/messages，包含几乎所有日志4) /var/log/warn，包含 WARNING 也就是级别 4 以上的所有日志5) /var/log/wtmp，包含和系统登录和重启的所有日志（补充：可以通过 last 命令读取）6) /var/log/YaST2/y2log，包含 YaST 的所有日志7) /var/log/xinetd.log，包含 xinetd 服务的所有日志8) /var/log/dump/，包含 Kdump 工具在系统宕机时收集的所有故障信息9) /var/log/atop，包含 Atop 工具收集的系统资源 （CPU、内存、系统进程、IO） 的所有使用信息]]></description>
										<content:encoded><![CDATA[
<p>1) /var/log/boot.msg，包含系统启动时显示在屏幕上的信息<br>（补充：当进入系统时，可以同时按下 “ctrl” 键和 “alt” 键和 “f10” 键切换到显示日志的界面，之后可以再通过 KVM 显示系统启动时显示在屏幕上的信息。）<br>2) /var/log/boot.omsg，包含上一次系统启动时显示在屏幕上的信息<br>3) /var/log/messages，包含几乎所有日志<br>4) /var/log/warn，包含 WARNING 也就是级别 4 以上的所有日志<br>5) /var/log/wtmp，包含和系统登录和重启的所有日志<br>（补充：可以通过 last 命令读取）<br>6) /var/log/YaST2/y2log，包含 YaST 的所有日志<br>7) /var/log/xinetd.log，包含 xinetd 服务的所有日志<br>8) /var/log/dump/，包含 Kdump 工具在系统宕机时收集的所有故障信息<br>9) /var/log/atop，包含 Atop 工具收集的系统资源 （CPU、内存、系统进程、IO） 的所有使用信息</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux 提高触发 Kdump 的几率</title>
		<link>https://eternalcenter-sep-2022.github.io/kdump-probability-increase/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 18 Feb 2022 09:12:39 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=22075</guid>

					<description><![CDATA[注意： 在提高触发 Kdump 的几率之前要先开启 Kdump： 正文： 步骤一：配置提高触发 Kdump 几率的参数 1.1 配置提高触发 Kdump 几率的参数 添加以下内容： 1.2 让刚刚配置的参数生效 （注意：此时每有一次软锁都会触发 Kdump） 步骤二：当 Kdmup 触发后分析奔溃的信息 步骤三；删除提高触发 Kdump 几率的参数 （重要） 3.1 删除提高触发 Kdump 几率的参数 （重要） 删除以下内容： 3.2 让刚刚删除参数的配置生效 （重要） （注意：此时每有一次软锁都会触发 Kdump） 参考文献： https://www.suse.com/support/kb/doc/?id=000019217]]></description>
										<content:encoded><![CDATA[
<h1 id="注意">注意：</h1>



<p>在提高触发 Kdump 的几率之前要先开启 Kdump：</p>



<div class="wp-container-1 wp-block-buttons">
<div class="wp-block-button aligncenter is-style-outline"><a class="wp-block-button__link no-border-radius" href="https://eternalcenter-sep-2022.github.io/kdump/">Linux Kdump 的开启 <br>（用于收集内核崩溃时的信息）</a></div>
</div>



<h1 id="正文">正文：</h1>



<h3 id="步骤一-配置提高触发-kdump-几率的参数1-1-配置提高触发-kdump-几率的参数">步骤一：配置提高触发 Kdump 几率的参数</h3>



<h4 id="步骤一-配置提高触发-kdump-几率的参数1-1-配置提高触发-kdump-几率的参数">1.1 配置提高触发 Kdump 几率的参数</h4>



<pre class="wp-block-code"><code># vim /etc/sysctl.conf</code></pre>



<p>添加以下内容：</p>



<pre class="wp-block-code"><code>......
kernel.softlockup_panic = 1</code></pre>



<h4 id="1-2-让刚刚配置的参数生效">1.2 让刚刚配置的参数生效</h4>



<pre class="wp-block-code"><code># sysctl -p</code></pre>



<p>（注意：此时每有一次软锁都会触发 Kdump）</p>



<h3 id="步骤二-当-kdmup-触发后分析奔溃的信息">步骤二：当 Kdmup 触发后分析奔溃的信息</h3>



<div class="wp-container-2 wp-block-buttons">
<div class="wp-block-button aligncenter is-style-outline"><a class="wp-block-button__link" href="https://eternalcenter-sep-2022.github.io/kdump-analysis/" style="border-radius:0px">Linux Kdump 内核奔溃信息的分析</a></div>
</div>



<h3 id="步骤三-删除提高触发-kdump-几率的参数-重要-3-1-删除提高触发-kdump-几率的参数-重要">步骤三；删除提高触发 Kdump 几率的参数 （重要）</h3>



<h4 id="步骤三-删除提高触发-kdump-几率的参数-重要-3-1-删除提高触发-kdump-几率的参数-重要">3.1 删除提高触发 Kdump 几率的参数 （重要）</h4>



<pre class="wp-block-code"><code># vim /etc/sysctl.conf</code></pre>



<p>删除以下内容：</p>



<pre class="wp-block-code"><code>......
kernel.softlockup_panic = 1</code></pre>



<h4 id="3-2-让刚刚删除参数的配置生效-重要">3.2 让刚刚删除参数的配置生效 （重要）</h4>



<pre class="wp-block-code"><code># sysctl -p</code></pre>



<p>（注意：此时每有一次软锁都会触发 Kdump）</p>



<h1>参考文献：</h1>



<p class="has-text-align-center">https://www.suse.com/support/kb/doc/?id=000019217</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux Kdump 的触发 （魔术键版）</title>
		<link>https://eternalcenter-sep-2022.github.io/kdump-trigger-magic-key/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 17 Feb 2022 09:25:43 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=22041</guid>

					<description><![CDATA[注意： 在触发 Kdump 之前要先开启 Kdump： 正文： 步骤一：在本地登录系统 （步骤略） 步骤二：强制同步屏幕 同时按下 “Left” 键和 “Alt” 键和 “Print Screen” 键和 “s” 键 步骤三：触发 Kdump 同时按下 “Left” 键和 “Alt” 键和 “Print Screen” 键和 “c” 键]]></description>
										<content:encoded><![CDATA[
<h1 id="注意">注意：</h1>



<p>在触发 Kdump 之前要先开启 Kdump：</p>



<div class="wp-container-3 wp-block-buttons">
<div class="wp-block-button aligncenter is-style-outline"><a class="wp-block-button__link no-border-radius" href="https://eternalcenter-sep-2022.github.io/kdump/">Linux Kdump 的开启 <br>（用于收集内核崩溃时的信息）</a></div>
</div>



<h1 id="正文">正文：</h1>



<h3 id="步骤一-在本地登陆系统">步骤一：在本地登录系统</h3>



<p>（步骤略）</p>



<h3 id="步骤二-强制同步屏幕">步骤二：强制同步屏幕</h3>



<p>同时按下 “Left” 键和 “Alt” 键和 “Print Screen” 键和 “s” 键</p>



<h3 id="步骤三-触发-kdump">步骤三：触发 Kdump</h3>



<p>同时按下 “Left” 键和 “Alt” 键和 “Print Screen” 键和 “c” 键</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 监控普通登录记录 （排除 SFTP 登录记录只监控普通登录记录）</title>
		<link>https://eternalcenter-sep-2022.github.io/shell-login-log-exclude-sftp/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 15 Feb 2022 14:52:50 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Language (语言)]]></category>
		<category><![CDATA[Other Service (其它服务)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tools (工具)]]></category>
		<category><![CDATA[Storage Service (存储服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=21977</guid>

					<description><![CDATA[注意： 在排除 SFTP 登录记录只监控普通登录记录前要先开启 SFTP 日志： 正文： 介绍 基本信息 作者：朱明宇名称：监控普通登录记录 （排除 SFTP 登录记录只监控普通登录记录）作用：监控普通登录记录 （排除 SFTP 登录记录只监控普通登录记录） 使用方法 1. 在此脚本的分割线内写入相应的内容2. 给此脚本添加执行权限3. 执行此脚本4. 普通登录记录会同时记录在系统日志和 $logfile 里 脚本分割线里的变量 1. logfile=logfile.txt #用户保存记录的文件2. prompt=&#8221;and no sftp info&#8221; #记录里普通登录记录的文件 脚本]]></description>
										<content:encoded><![CDATA[
<h1 id="注意">注意：</h1>



<p>在排除 SFTP 登录记录只监控普通登录记录前要先开启 SFTP 日志：</p>



<div class="wp-container-4 wp-block-buttons">
<div class="wp-block-button aligncenter is-style-outline"><a class="wp-block-button__link" href="https://eternalcenter-sep-2022.github.io/sftp-log/" style="border-radius:0px">SFTP 日志的开启</a></div>
</div>



<h1>正文：</h1>



<h2 id="介绍">介绍</h2>



<h3>基本信息</h3>



<p>作者：朱明宇<br>名称：监控普通登录记录 （排除 SFTP 登录记录只监控普通登录记录）<br>作用：监控普通登录记录 （排除 SFTP 登录记录只监控普通登录记录）</p>



<h3>使用方法</h3>



<p>1. 在此脚本的分割线内写入相应的内容<br>2. 给此脚本添加执行权限<br>3. 执行此脚本<br>4. 普通登录记录会同时记录在系统日志和 $logfile 里</p>



<h3>脚本分割线里的变量</h3>



<p>1. logfile=logfile.txt #用户保存记录的文件<br>2. prompt=&#8221;and no sftp info&#8221; #记录里普通登录记录的文件</p>



<h2 id="脚本">脚本</h2>



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

####################### Separator ########################

logfile=logfile.txt
prompt="and no sftp info"

####################### Separator ########################

checktime=`date +%Y-%m-%dT%H -d "-1 day"`

for i in `cat -n /var/log/messages | grep $check_time | grep 'Started Session' | grep -v 'root' | awk '{print $1}'`

do
   line=`sed -n $&#91;i]p /var/log/messages`
   time=`echo $line | awk '{print $1}'`
   session=`echo $line | awk '{print $6}'`
   user=`echo $line | awk '{print $9}'`
   user=${user%.}

   message="ACCESS CHECK LOG: Time:$time Session:$session $user has accessed `hostname`, $prompt"

   let sftpline=i+3

   sed -n $&#91;sftpline]p /var/log/messages | grep sftp-server &amp;&gt; /dev/null
   if &#91; $? -ne 0 ];then
           echo $message
           echo $message &gt;&gt; $logfile.txt
           logger $message
   fi
   echo
done</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 logger （手动向系统日志写入信息）</title>
		<link>https://eternalcenter-sep-2022.github.io/logger/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 15 Feb 2022 13:15:26 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=21966</guid>

					<description><![CDATA[内容一：手动向系统日志写入信息 （补充：这里以往系统日志里写入一条包含 This is test message 内容的信息为例） 内容二：显示手动向系统日志写入信息 （补充：这里在系统里查找一条包含 This is test message 内容的信息为例）]]></description>
										<content:encoded><![CDATA[
<h3 id="内容一-手动向系统日志写入信息">内容一：手动向系统日志写入信息</h3>



<pre class="wp-block-code"><code># logger &#91;This is test message]</code></pre>



<p>（补充：这里以往系统日志里写入一条包含 This is test message 内容的信息为例）</p>



<h3 id="内容二-显示手动向系统日志写入信息">内容二：显示手动向系统日志写入信息</h3>



<pre class="wp-block-code"><code># grep "This is test message" /var/log/messages</code></pre>



<p>（补充：这里在系统里查找一条包含 This is test message 内容的信息为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux Kdump 内核奔溃信息的分析 （Rocky Linux &#038; RHEL 版）</title>
		<link>https://eternalcenter-sep-2022.github.io/kdump-analysis/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 15 Feb 2022 07:49:50 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=21941</guid>

					<description><![CDATA[步骤一：开启 Kdump 1.1 确保 crash 和 kernel-debuginfo 两个软件包已安装 1.2 给 Kdump 分配保留内存 1.2.1 通过在 /etc/default/grub 配置文件里修改 crashkernel 参数 在这一行里： 添加： （补充：这里的 auto 代表系统会根据内存大小自动设置一个值，也可以指定一个值，例如：crashkernel=128M,high、crashkernel=256M,high 等等。如果设置成一个固定值，建议1) 1 GB 到 4 GB 内存设置成 160 M2) 4 GB 到 64 GB 内存设置成 192 M3) 64 GB 到 1 TB 内存设置成 256 M4) 大于 1 TB 内存设置成 512 M） 1.2.2 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/kdump-analysis/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] Linux Kdump 内核奔溃信息的分析 （Rocky Linux &#038; RHEL 版）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：开启 Kdump</h3>



<h4 id="步骤一-确保-crash-和-kernel-debuginfo-两个软件包已安装">1.1 确保 crash 和 kernel-debuginfo 两个软件包已安装</h4>



<pre class="wp-block-code"><code># rpm -qa | grep crash || dnf install crash ; rpm -qa | grep kernel-debug || dnf install kernel-debug</code></pre>



<h4>1.2 给 Kdump 分配保留内存</h4>



<h5>1.2.1 通过在 /etc/default/grub 配置文件里修改 crashkernel 参数</h5>



<pre class="wp-block-code"><code># vim /etc/default/grub</code></pre>



<p>在这一行里：</p>



<pre class="wp-block-code"><code>GRUB_CMDLINE_LINUX_DEFAULT="......"</code></pre>



<p>添加：</p>



<pre class="wp-block-code"><code>GRUB_CMDLINE_LINUX_DEFAULT="...... crashkernel=auto"</code></pre>



<p>（<br>补充：这里的 auto 代表系统会根据内存大小自动设置一个值，也可以指定一个值，例如：crashkernel=128M,high、crashkernel=256M,high 等等。如果设置成一个固定值，建议<br>1) 1 GB 到 4 GB 内存设置成 160 M<br>2) 4 GB 到 64 GB 内存设置成 192 M<br>3) 64 GB 到 1 TB 内存设置成 256 M<br>4) 大于 1 TB 内存设置成 512 M<br>）</p>



<h5>1.2.2 让刚刚修改的内核参数生效</h5>



<pre class="wp-block-code"><code># grub2-mkconfig -o /boot/grub2/grub.cfg;reboot</code></pre>



<h5>1.2.3 显示给 Kdump 预留内存的大小</h5>



<pre class="wp-block-code"><code># makedumpfile --mem-usage /proc/kcore</code></pre>



<h3>步骤二：触发 Kdump 内核奔溃</h3>



<pre class="wp-block-code"><code># echo 1 &gt; /proc/sys/kernel/sysrq
# echo c &gt; /proc/sysrq-trigger</code></pre>



<h3>步骤三：分析 KDUMP 生成的内核奔溃信息</h3>



<h4 id="步骤二-进入存放-kdump-内核奔溃信息的目录">3.1 进入存放 KDUMP 内核奔溃信息的目录</h4>



<pre class="wp-block-code"><code># cd /var/crash/&lt;date&gt;/</code></pre>



<h4 id="步骤三-解析-kdump-生成内核崩溃信息">3.2 解析 KDUMP 生成内核崩溃信息</h4>



<pre class="wp-block-code"><code># crash vmlinux-2.6.32.12-0.7-default vmcore</code></pre>



<p>（补充：这里以使用 2.6.32.12-0.7-default 版本的 kernel-debuginfo 解析为例）</p>



<h4 id="步骤四-确认生成了-vmlinux-2-6-32-12-0-7-default-gz-压缩包">3.3 确认生成了 vmlinux-2.6.32.12-0.7-default.gz 压缩包</h4>



<pre class="wp-block-code"><code># ls vmlinux-2.6.32.12-0.7-default.gz</code></pre>



<p>（注意：如果这里生成了 vmlinux-2.6.32.12-0.7-default.gz 压缩包的话，这里会有 vmlinux-2.6.32.12-0.7-default.gz 信息的显示）</p>



<p>（补充：这里以确认 2.6.32.12-0.7-default 版本的 kernel-debuginfo 生成的压缩包为例）</p>



<h4 id="步骤五-解压-vmlinux-2-6-32-12-0-7-default-gz-压缩包">3.4 解压 vmlinux-2.6.32.12-0.7-default.gz 压缩包</h4>



<pre class="wp-block-code"><code># gzip -d vmlinux-2.6.32.12-0.7-default.gz</code></pre>



<p>（补充：这里以解压 2.6.32.12-0.7-default 版本的 kernel-debuginfo 生成的压缩包为例）</p>



<h4 id="步骤六-分析-kdump-生成的内核奔溃信息">3.5 分析 KDUMP 生成的内核奔溃信息</h4>



<p>（步骤略）</p>



<h1>参考文献：</h1>



<p class="has-text-align-center">https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_monitoring_and_updating_the_kernel/analyzing-a-core-dump_managing-monitoring-and-updating-the-kernel</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 用户登录相关日志</title>
		<link>https://eternalcenter-sep-2022.github.io/login-log/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 12 Feb 2022 15:49:11 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=21918</guid>

					<description><![CDATA[内容一：所有用户正在登录的记录 1.1 所有用户正在登录的记录 1.1 所有用户正在登录记录的显示 或者： 或者： 内容二：所有用户登录和登出的记录 2.1 所有用户登录和登出的记录 2.1 所有用户登录和登出记录的显示 （注意：last 命令显示用户时最多只会显示前 8 个字符） 或者： 内容三：所有用户最后一次登录的记录 3.1 所有用户最后一次登录的记录 3.2 所有用户最后一次登录记录的显示 内容四：所有错误登录尝试的记录 4.1 所有错误登录尝试的记录 4.2 所有错误登录尝试记录的显示 内容五：所有信息 （其中也包括用户登录相关的记录） 内容六：所有用户登录相关的记录]]></description>
										<content:encoded><![CDATA[
<h3 id="内容一-所有正在登录的用户">内容一：所有用户正在登录的记录</h3>



<h4 id="内容一-所有正在登录的用户">1.1 所有用户正在登录的记录</h4>



<pre class="wp-block-code"><code>/var/run/utmp</code></pre>



<h4>1.1 所有用户正在登录记录的显示</h4>



<pre class="wp-block-code"><code># who</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># w</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># users</code></pre>



<h3 id="内容二-所有的登录和登出记录">内容二：所有用户登录和登出的记录</h3>



<h4 id="内容二-所有的登录和登出记录">2.1 所有用户登录和登出的记录</h4>



<pre class="wp-block-code"><code>/var/log/wtmp</code></pre>



<h4>2.1 所有用户登录和登出记录的显示</h4>



<pre class="wp-block-code"><code># last</code></pre>



<div class="wp-container-5 wp-block-buttons">
<div class="wp-block-button"><a class="wp-block-button__link" href="https://eternalcenter-sep-2022.github.io/last/" style="border-radius:0px">Linux 命令 last</a></div>



<div class="wp-block-button"><a class="wp-block-button__link" href="https://eternalcenter-sep-2022.github.io/wtmp/" style="border-radius:0px">wtmp 日志保存时间默认策略的设置</a></div>
</div>



<p>（注意：last 命令显示用户时最多只会显示前 8 个字符）</p>



<p>或者：</p>



<pre class="wp-block-code"><code># ac</code></pre>



<h3 id="内容三-所有用户最有一次登录记录">内容三：所有用户最后一次登录的记录</h3>



<h4 id="内容三-所有用户最有一次登录记录">3.1 所有用户最后一次登录的记录</h4>



<pre class="wp-block-code"><code>/var/log/lastlog</code></pre>



<h4>3.2 所有用户最后一次登录记录的显示</h4>



<pre class="wp-block-code"><code># lastlog</code></pre>



<h3 id="内容四-所有错误登录尝试记录">内容四：所有错误登录尝试的记录</h3>



<h4 id="内容四-所有错误登录尝试记录">4.1 所有错误登录尝试的记录</h4>



<pre class="wp-block-code"><code>/var/log/btmp</code></pre>



<h4>4.2 所有错误登录尝试记录的显示</h4>



<pre class="wp-block-code"><code># lastb</code></pre>



<h3 id="内容五-所有信息-其中也包括登录相关的记录">内容五：所有信息 （其中也包括用户登录相关的记录）</h3>



<pre class="wp-block-code"><code>/var/log/messages</code></pre>



<h3>内容六：所有用户登录相关的记录</h3>



<pre class="wp-block-code"><code>/var/log/secure</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 周期性计划任务 cron 日志</title>
		<link>https://eternalcenter-sep-2022.github.io/cron-log/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 12 Feb 2022 15:33:20 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=21914</guid>

					<description><![CDATA[如果是 Rocky Linux &#38; RHEL： 如果是 openSUSE &#38; SLE：]]></description>
										<content:encoded><![CDATA[
<p>如果是 Rocky Linux &amp; RHEL：</p>



<pre class="wp-block-code"><code>/var/log/cron</code></pre>



<p>如果是 openSUSE &amp; SLE：</p>



<pre class="wp-block-code"><code>/var/spool/mail/&lt;user&gt;</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 关机或重启记录的显示</title>
		<link>https://eternalcenter-sep-2022.github.io/viewing-of-shutdown-or-restart-records/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 10 Nov 2021 13:09:21 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=18281</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code># /usr/bin/last -xF | egrep "reboot|shutdown|runlevel|system"</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令  dmesg （显示开机日志）</title>
		<link>https://eternalcenter-sep-2022.github.io/dmesg/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 29 Oct 2021 09:17:24 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=18117</guid>

					<description><![CDATA[内容一：dmesg 简介 Linux 的 kernel 会把开机日子存储在 ring buffer 和 /var/log/message 中，其中 ring buffer 里的开机日志可以使用 dmesg 来显示，如果开机时的提示信息来不及阅读的话，可以通过 dmesg 命令来显示 内容二：dmesg 命令的选项 1) -c 显示 ring buffer 的日志后清空 ring buffer2) -n 显示日志的层级3) -cn 显示 ring buffer 的日志后清空 ring buffer，同时显示日志的层级4) -s 设置缓冲区的大小，默认为 8196 与 ring buffer 的大小一样 内容三：dmesg 命令的使用案例 3.1 显示所有开机日志 3.2 显示所有日志，显示 ring buffer 的日志后清空 ring buffer，同时显示日志的层级 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/dmesg/" class="more-link">Continue reading<span class="screen-reader-text"> "[命令] Linux 命令  dmesg （显示开机日志）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3 id="内容一-dmesg-简介">内容一：dmesg 简介</h3>



<p>Linux 的 kernel 会把开机日子存储在 ring buffer 和 /var/log/message 中，其中 ring buffer 里的开机日志可以使用 dmesg 来显示，如果开机时的提示信息来不及阅读的话，可以通过 dmesg 命令来显示</p>



<h3 id="内容二-dmesg-的选项">内容二：dmesg 命令的选项</h3>



<p>1) -c 显示 ring buffer 的日志后清空 ring buffer<br>2) -n 显示日志的层级<br>3) -cn 显示 ring buffer 的日志后清空 ring buffer，同时显示日志的层级<br>4) -s 设置缓冲区的大小，默认为 8196 与 ring buffer 的大小一样</p>



<h3 id="内容三-dmesg-命令的使用案例-3-1-显示所有开机日志">内容三：dmesg 命令的使用案例</h3>



<h4 id="内容三-dmesg-命令的使用案例-3-1-显示所有开机日志">3.1 显示所有开机日志</h4>



<pre class="wp-block-code"><code># dmesg | less</code></pre>



<h4 id="3-2-显示所有日志-显示-ring-buffer-的日志后清空-ring-buffer-同时显示日志的层级">3.2 显示所有日志，显示 ring buffer 的日志后清空 ring buffer，同时显示日志的层级</h4>



<pre class="wp-block-code"><code># dmesg -cn</code></pre>



<h4 id="3-3-显示所有失败的开机日志">3.3 显示所有失败的开机日志</h4>



<pre class="wp-block-code"><code># dmesg | egrep -i "fail|warn|error"</code></pre>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] SELinux  的启用 （openSUSE &#038; SLE  版） （不建议）</title>
		<link>https://eternalcenter-sep-2022.github.io/selinux-opensuse-sle/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 01 Jun 2021 08:50:14 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[SELinux]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Port Security (系统端口安全)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=14516</guid>

					<description><![CDATA[软件准备： 在 SELinuxProject 的官网上下载 SELinux 策略 UseRefpolicy： https://github.com/SELinuxProject/refpolicy/wiki/UseRefpolicy 注意： 1) 如果使用此文的方法将 openSUSE &#38; SLE 的 SELinux 设置为 Enforcing 则系统将无法设置 IP 地址2) 如果使用此文的方法开启了 SELinux 并且将所有的布尔（boolean）值开启，则系统将无法关机，开启所有布尔值的方法：# for i in semanage boolean -l &#124; awk '{print $1}'; do echo $i;setsebool -P $i 1; done 正文： 步骤一：安装 SELinux 组件 步骤二：安装 SELinux 策略 2.1 解压包含 SELinux 策略的压缩包 （补充：这里以解压 refpolicy-2.20210203.tar.bz2 压缩包为例） &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/selinux-opensuse-sle/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] SELinux  的启用 （openSUSE &#038; SLE  版） （不建议）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h1 id="软件准备">软件准备：</h1>



<p>在 SELinuxProject 的官网上下载 SELinux 策略 UseRefpolicy：</p>



<p class="has-text-align-center"><a href="https://github.com/SELinuxProject/refpolicy/wiki/UseRefpolicy" target="_blank" rel="noreferrer noopener">https://github.com/SELinuxProject/refpolicy/wiki/UseRefpolicy</a></p>



<h1 id="注意">注意：</h1>



<p>1) 如果使用此文的方法将 openSUSE &amp; SLE 的 SELinux 设置为 Enforcing 则系统将无法设置 IP 地址<br>2) 如果使用此文的方法开启了 SELinux 并且将所有的布尔（boolean）值开启，则系统将无法关机，开启所有布尔值的方法：# for i in <code>semanage boolean -l | awk '{print $1}'</code>; do echo $i;setsebool -P $i 1; done</p>



<h1 id="正文">正文：</h1>



<h3 id="步骤一-安装-selinux-组件">步骤一：安装 SELinux 组件</h3>



<pre class="wp-block-code"><code># zypper in libselinux1 libsemanage1 libsepol-devel libsepol1 libselinux-devel mcstrans libselinux1-32bit policycoreutils checkpolicy libsemanage-devel setools-tcl setools-libs setools-java setools-devel setools-console selinux-tools python3-policycoreutils python3-selinux python3-semanage python3-setools restorecond</code></pre>



<h3 id="步骤二-安装-selinux-策略-2-1-解压包含-selinux-策略的压缩包">步骤二：安装 SELinux 策略</h3>



<h4 id="步骤二-安装-selinux-策略-2-1-解压包含-selinux-策略的压缩包">2.1 解压包含 SELinux 策略的压缩包</h4>



<pre class="wp-block-code"><code># tar -xvf refpolicy-2.20210203.tar.bz2</code></pre>



<p>（补充：这里以解压 refpolicy-2.20210203.tar.bz2 压缩包为例）</p>



<h4 id="2-2-将-selinux-策略移动到-selinux-配置文件的位置">2.2 将 SELinux 策略移动到 SELinux 配置文件的位置</h4>



<pre class="wp-block-code"><code># mv refpolicy /etc/selinux/</code></pre>



<h4 id="2-3-进入到和-selinux-策略相同目录下">2.3 进入到和 SELinux 策略相同目录下</h4>



<pre class="wp-block-code"><code># cd /etc/selinux/refpolicy/</code></pre>



<h4 id="2-4-显示-selinux-策略的安装手册">2.4 显示 SELinux 策略的安装手册</h4>



<pre class="wp-block-code"><code># cat INSTALL</code></pre>



<h4 id="2-5-创建-selinux-策略的配置文件">2.5 创建 SELinux 策略的配置文件</h4>



<pre class="wp-block-code"><code># make conf</code></pre>



<h4 id="2-6-创建-selinux-策略">2.6 创建 SELinux 策略</h4>



<pre class="wp-block-code"><code># make policy</code></pre>



<h4 id="2-7-编译-selinux-策略">2.7 编译 SELinux 策略</h4>



<pre class="wp-block-code"><code># make install</code></pre>



<h4 id="2-8-安装-selinux-策略">2.8 安装 SELinux 策略</h4>



<pre class="wp-block-code"><code># make load</code></pre>



<h3 id="步骤三-配置-selinux-配置文件-3-1-在-selinux-配置文件中将-selinux-设置为-permissive-状态">步骤三：配置 SELinux 配置文件</h3>



<h4 id="步骤三-配置-selinux-配置文件-3-1-在-selinux-配置文件中将-selinux-设置为-permissive-状态">3.1 在 SELinux 配置文件中将 SELinux 设置为 Permissive 状态</h4>



<pre class="wp-block-code"><code># vim /etc/selinux/config</code></pre>



<p>创建以下内容：</p>



<pre class="wp-block-code"><code># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=refpolicy</code></pre>



<h4 id="3-2-在系统内核中禁止使用-apparmor-使用-selinux-并且将-selinux-状态设置为-permissive-3-2-1-设置-grub-文件">3.2 在系统内核中禁止使用 AppArmor 使用 SELinux 并且将 SELinux 状态设置为 Permissive</h4>



<h5 id="3-2-在系统内核中禁止使用-apparmor-使用-selinux-并且将-selinux-状态设置为-permissive-3-2-1-设置-grub-文件">3.2.1 设置 /etc/default/grub 配置文件</h5>



<pre class="wp-block-code"><code># vim /etc/default/grub</code></pre>



<p>在这一行里：</p>



<pre class="wp-block-code"><code>GRUB_CMDLINE_LINUX_DEFAULT="......"</code></pre>



<pre class="wp-block-code"><code>添加以下内容：</code></pre>



<pre class="wp-block-code"><code>GRUB_CMDLINE_LINUX_DEFAULT="...... security=selinux selinux=1 enforcing=0"</code></pre>



<h5 id="3-2-2-让刚刚设置的-grub-文件生效">3.2.2 让刚刚设置的 /etc/default/grub 配置文件生效</h5>



<pre class="wp-block-code"><code># grub2-mkconfig -o /boot/grub2/grub.cfg</code></pre>



<h4 id="3-3-刷新系统内所有文件的标签">3.3 刷新系统内所有文件的标签</h4>



<pre class="wp-block-code"><code># restorecon -Rp /</code></pre>



<h3 id="步骤四-重启系统让-selinux-生效">步骤四：重启系统让 SELinux 生效</h3>



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



<h1 id="参考文献">参考文献：</h1>



<p class="has-text-align-center">https://documentation.suse.com/sles/15-SP2/html/SLES-all/cha-selinux.html</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
