<?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 Security (系统安全) &#8211; Eternal Center</title>
	<atom:link href="https://eternalcenter-2021-12.github.io/category/system/system-network-system-security-system-log/system-security/feed/" rel="self" type="application/rss+xml" />
	<link>https://eternalcenter-2021-12.github.io/</link>
	<description></description>
	<lastBuildDate>Sun, 26 Dec 2021 08:37:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>[步骤] Linux SSL 证书的生成 （Let&#8217;s Encrypt certbot 版）</title>
		<link>https://eternalcenter-2021-12.github.io/ssl-lets-encrypt-certbot/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sun, 19 Dec 2021 15:12:46 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Basic Guidelines for Website building (网站建设基础指南)]]></category>
		<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Django Service (服务)]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Nginx Security (安全)]]></category>
		<category><![CDATA[Personal Website Building (个人网站建设)]]></category>
		<category><![CDATA[Project (项目)]]></category>
		<category><![CDATA[Services (服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Port Security (系统端口安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[Website Services (网站服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=19886</guid>

					<description><![CDATA[步骤目录： 步骤一：将要申请 Let&#8217;s Encrypt SSL 的域名解析到要进行操作的服务器 IP 地址上 步骤二：安装 certbot 步骤三：使用 certbot 生成 Let&#8217;s Encrypt SSL 证书 步骤四：查看已经生成的 Let&#8217;s Encrypt SSL 证书 步骤五：延期 Let&#8217;s Encrypt SSL 证书5.1 查看 Let&#8217;s Encrypt SSL 证书的延期策略5.2 手动延期 Let&#8217;s Encrypt SSL 证书5.3 自动延期 Let&#8217;s Encrypt SSL 证书 步骤六：Let’s Encrypt SSL 证书的生成限制 具体的操作步骤： 步骤一：将要申请 Let&#8217;s Encrypt SSL 的域名解析到要进行操作的服务器 IP 地址上 （步骤略） &#8230; <p class="link-more"><a href="https://eternalcenter-2021-12.github.io/ssl-lets-encrypt-certbot/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] Linux SSL 证书的生成 （Let&#8217;s Encrypt certbot 版）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2>步骤目录：</h2>



<h4>步骤一：将要申请 Let&#8217;s Encrypt SSL 的域名解析到要进行操作的服务器 IP 地址上</h4>



<h4>步骤二：安装 certbot</h4>



<h4>步骤三：使用 certbot 生成 Let&#8217;s Encrypt SSL 证书</h4>



<h4>步骤四：查看已经生成的 Let&#8217;s Encrypt SSL 证书</h4>



<h4>步骤五：延期 Let&#8217;s Encrypt SSL 证书<br>5.1 查看 Let&#8217;s Encrypt SSL 证书的延期策略<br>5.2 手动延期 Let&#8217;s Encrypt SSL 证书<br>5.3 自动延期 Let&#8217;s Encrypt SSL 证书</h4>



<h4>步骤六：Let’s Encrypt SSL 证书的生成限制</h4>



<h2>具体的操作步骤：</h2>



<h4>步骤一：将要申请 Let&#8217;s Encrypt SSL 的域名解析到要进行操作的服务器 IP 地址上</h4>



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



<h4>步骤二：安装 certbot</h4>



<pre class="wp-block-code"><code># yum -y install certbot</code></pre>



<p>（补充：这里以在 Fedora 35 上安装 certbot 为例）</p>



<h4>步骤三：使用 certbot 生成 Let&#8217;s Encrypt SSL 证书</h4>



<pre class="wp-block-code"><code># certbot certonly --email mingyu.zhu@eternalcenter.com -n --agree-tos --webroot -w /usr/share/nginx/html/ -d eternalcenter.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Requesting a certificate for eternalcenter.com
Performing the following challenges:
http-01 challenge for eternalcenter.com
Using the webroot path /usr/share/nginx/html for all unmatched domains.
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/eternalcenter.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/eternalcenter.com/privkey.pem
   Your certificate will expire on 2022-03-20. To obtain a new or
   tweaked version of this certificate in the future, simply run
   certbot again. To non-interactively renew *all* of your
   certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le</code></pre>



<p>（<br>补充：这里以<br>1) 使用 mingyu.zhu@eternalcenter.com 邮箱<br>2) 以非交互式的方式<br>3) 通过给 /usr/share/nginx/html/ 网站目录里添加验证文件进行验证<br>4) 给 eternalcenter.com 域名<br>申请 Let&#8217;s Encrypt SSL 证书为例<br>）</p>



<h4>步骤四：查看已经生成的 Let&#8217;s Encrypt SSL 证书</h4>



<pre class="wp-block-code"><code># certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: eternalcenter.com
    Serial Number: 3e8cdb74a1abfbf3d535ec1c3f8cb3e4e4c
    Key Type: RSA
    Domains: eternalcenter.com
    Expiry Date: 2022-03-20 13:48:48+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/eternalcenter.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/eternalcenter.com/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
</code></pre>



<p>（<br>补充：<br>1) /etc/letsencrypt/live/eternalcenter.com/fullchain.pem 是公钥<br>2) /etc/letsencrypt/live/eternalcenter.com/privkey.pem 是私钥<br>）</p>



<h4>步骤五：延期 Let&#8217;s Encrypt SSL 证书<br>5.1 查看 Let&#8217;s Encrypt SSL 证书的延期策略</h4>



<pre class="wp-block-code"><code># cat /etc/letsencrypt/renewal/eternalcenter.com.conf 
# renew_before_expiry = 30 days
version = 1.20.0
archive_dir = /etc/letsencrypt/archive/eternalcenter.com
cert = /etc/letsencrypt/live/eternalcenter.com/cert.pem
privkey = /etc/letsencrypt/live/eternalcenter.com/privkey.pem
chain = /etc/letsencrypt/live/eternalcenter.com/chain.pem
fullchain = /etc/letsencrypt/live/eternalcenter.com/fullchain.pem</code></pre>



<p>（补充：可以看出 Let&#8217;s Encrypt SSL 证书是在过期前 30 天才能更新）</p>



<h4>5.2 手动延期 Let&#8217;s Encrypt SSL 证书</h4>



<pre class="wp-block-code"><code># /usr/bin/certbot renew</code></pre>



<p>（补充：这里以延期 Let&#8217;s Encrypt SSL 证书为例）</p>



<h4>5.3 自动延期 Let&#8217;s Encrypt SSL 证书</h4>



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



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



<pre class="wp-block-code"><code>......
0 0 */30 * * /usr/bin/certbot renew</code></pre>



<p>（补充：这里以每过 30 天的 0 时 0 分延期 Let&#8217;s Encrypt SSL 证书为例）</p>



<h4>步骤六：Let’s Encrypt SSL 证书的生成限制</h4>



<p>1) 一个域名申请次数不能超过 5 次/周<br>2) 允许申请失败次数不能超过 5 次/时<br>3) 属于同一个顶级域名的二级域名申请次数不能超过 20 次/周<br>4) 申请请求频率不能超过 20 次/秒<br>5) 一个 IP 地址创建用户个数不能超过 10 个/3 小时<br>6) 一个用户最多 pending 审核的数不能超过 300 个</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 ssh （远程登录）</title>
		<link>https://eternalcenter-2021-12.github.io/ssh/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 26 Nov 2021 15:56:06 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></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>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=19146</guid>

					<description><![CDATA[案例一：脚本中常用的方式 （补充：这里以1) 安静模式2) 打开新端口的模式3) 不检查服务器记录4) 超时时间为 5 秒5) 通过 eternalcenter 用户6) 登录 eternalcenter.com 服务器为例） 案例二：在操作中常用的方式 （补充：这里以1) 带图形的模式2) 通过 eternalcenter 用户3) 登录 eternalcenter.com 服务器为例）]]></description>
										<content:encoded><![CDATA[
<h2>案例一：脚本中常用的方式</h2>



<pre class="wp-block-code"><code># ssh -q -t -t -o StrictHostKeyChecking=no -o ConnectTimeout=5 -l eternalcenter eternalcenter.com</code></pre>



<p>（<br>补充：这里以<br>1) 安静模式<br>2) 打开新端口的模式<br>3) 不检查服务器记录<br>4) 超时时间为 5 秒<br>5) 通过 eternalcenter 用户<br>6) 登录 eternalcenter.com 服务器<br>为例<br>）</p>



<h2>案例二：在操作中常用的方式</h2>



<pre class="wp-block-code"><code># ssh -X eternalcenter@eternalcenter.com</code></pre>



<p>（<br>补充：这里以<br>1) 带图形的模式<br>2) 通过 eternalcenter 用户<br>3) 登录 eternalcenter.com 服务器<br>为例<br>）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux 加密压缩 （tar 版）</title>
		<link>https://eternalcenter-2021-12.github.io/encryption-compression-tar/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 15 Nov 2021 15:52:52 +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 Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=18392</guid>

					<description><![CDATA[步骤一：创建测试文件 （补充：这里以创建 test.txt 文件为例） 步骤二：加密压缩文件或目录2.1 交互式加密压缩文件或目录 （补充：1) 这里以将 test.txt 文件加密压缩成 test1.tar.gz （压缩）包为例2) 如果要以 bzip2 的格式进行压缩，则将命令中的 -zcf 换成 -jcvf 将 test1.tar.gz 换成 test1.tar.bz23) 如果要以 xz 的格式进行压缩，则将命令中的 -zcf 换成 -Jcvf 将 test1.tar.gz 换成 test1.tar.xz） 2.2 非交互式加密压缩文件或目录 （补充：1) 这里以将 test.txt 文件加密压缩成 test1.tar.gz （压缩）包并且将密码设置为 eternalcenter 为例2) 如果要以 bzip2 的格式进行压缩，则将命令中的 -zcf 换成 -jcvf 将 test1.tar.gz 换成 test2.tar.bz23) 如果要以 xz 的格式进行压缩，则将命令中的 &#8230; <p class="link-more"><a href="https://eternalcenter-2021-12.github.io/encryption-compression-tar/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] Linux 加密压缩 （tar 版）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h4>步骤一：创建测试文件</h4>



<pre class="wp-block-code"><code># touch test.txt</code></pre>



<p>（补充：这里以创建 test.txt 文件为例）</p>



<h4>步骤二：加密压缩文件或目录<br>2.1 交互式加密压缩文件或目录</h4>



<pre class="wp-block-code"><code># tar -zcf - test.txt | openssl des3 -salt | dd of=test1.tar.gz
enter des-ede3-cbc encryption password:
Verifying - enter des-ede3-cbc encryption password:
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
0+1 records in
0+1 records out
224 bytes copied, 7.04902 s, 0.0 kB/s</code></pre>



<p>（<br>补充：<br>1) 这里以将 test.txt 文件加密压缩成 test1.tar.gz （压缩）包为例<br>2) 如果要以 bzip2 的格式进行压缩，则将命令中的 -zcf 换成 -jcvf 将 test1.tar.gz 换成 test1.tar.bz2<br>3) 如果要以 xz 的格式进行压缩，则将命令中的 -zcf 换成 -Jcvf 将 test1.tar.gz 换成 test1.tar.xz<br>）</p>



<h4>2.2 非交互式加密压缩文件或目录</h4>



<pre class="wp-block-code"><code># tar -zcf - test.txt | openssl des3 -salt -f eternalcenter | dd of=test2.tar.gz
des3: Unrecognized flag f
des3: Use -help for summary.
0+0 records in
0+0 records out
0 bytes copied, 0.00376576 s, 0.0 kB/s</code></pre>



<p>（<br>补充：<br>1) 这里以将 test.txt 文件加密压缩成 test1.tar.gz （压缩）包并且将密码设置为 eternalcenter 为例<br>2) 如果要以 bzip2 的格式进行压缩，则将命令中的 -zcf 换成 -jcvf 将 test1.tar.gz 换成 test2.tar.bz2<br>3) 如果要以 xz 的格式进行压缩，则将命令中的 -zcf 换成 -Jcvf 将 test1.tar.gz 换成 test2.tar.xz<br>）</p>



<h4>步骤三：解压加密文件或目录<br>3.1 交互式解压加密文件或目录<br>3.1.1 删除原测试目录和里面的文件</h4>



<pre class="wp-block-code"><code># rm -rf test.txt</code></pre>



<p>（补充：这里以删除 test.txt 文件为例）</p>



<h4>3.1.2 交互式解压加密文件或目录</h4>



<pre class="wp-block-code"><code># dd if=test2.tar.gz | openssl des3 -d | tar zxf -
0+1 records in
0+1 records out
224 bytes copied, 0.000589721 s, 380 kB/s
enter des-ede3-cbc decryption password:
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.</code></pre>



<p>（<br>补充：<br>1) 这里以解压 test2.tar.gz （压缩）包为例<br>2) 如果是 bzip2 格式的（压缩）包，则将命令中的 -zxf 换成 -jcvf 将 test1.tar.gz 换成 test1.tar.bz2<br>3) 如果是 xz 格式的（压缩）包，则将命令中的 -zxf 换成 -Jcvf 将 test1.tar.gz 换成 test1.tar.xz<br>）</p>



<h4>3.2 非交互式解压加密文件或目录<br>3.2.1 删除原测试目录和里面的文件</h4>



<pre class="wp-block-code"><code># rm -rf test.txt</code></pre>



<p>（补充：这里以删除 test.txt 文件为例）</p>



<h4>3.2.2 非交互式解压加密文件或目录</h4>



<pre class="wp-block-code"><code># dd if=test1.tar.gz | openssl des3 -d -k eternalcenter | tar zxf -
0+1 records in
0+1 records out
224 bytes copied, 0.000574539 s, 390 kB/s
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.</code></pre>



<p>（<br>补充：<br>1) 这里以解压 test1.tar.gz （压缩）包并且解压密码为 eternalcenter 为例<br>2) 如果是 bzip2 格式的（压缩）包，则将命令中的 -zxf 换成 -jcvf 将 test1.tar.gz 换成 test1.tar.bz2<br>3) 如果是 xz 格式的（压缩）包，则将命令中的 -zxf 换成 -Jcvf 将 test1.tar.gz 换成 test1.tar.xz<br>）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux 加密压缩 （zip 版）</title>
		<link>https://eternalcenter-2021-12.github.io/encryption-compression-zip/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 15 Nov 2021 15:48:09 +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 Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=18388</guid>

					<description><![CDATA[步骤一：创建测试目录和测试文件 （补充：这里以创建 test 目录和里面的 test.txt 文件为例） 步骤二：加密压缩文件或目录2.1 交互式加密压缩文件或目录 （补充：这里以将 test 目录和里面的 test.txt 文件加密压缩成 test1.zip （压缩）包为例） 2.2 非交互式加密解压文件或目录 （补充：这里以将 test 目录和里面的 test.txt 文件加密压缩成 test2.zip （压缩）包并且将密码设置为 eternalcenter 为例） 步骤三：解压加密文件或目录3.1 交互式解压加密文件或目录3.1.1 删除原测试目录和里面的文件 （补充：这里以删除 test 目录和里面的文件为例） 3.1.2 交互式解压加密文件或目录 （补充：这里以解压 test2.zip （压缩）包为例） 3.2 非交互式解压加密文件或目录3.2.1 删除原测试目录和里面的文件 （补充：这里以删除 test 目录和里面的文件为例） 3.2.2 非交互式解压加密文件 （补充：这里以解压 test2.zip （压缩）包并且解压密码为 eternalcenter 为例）]]></description>
										<content:encoded><![CDATA[
<h4>步骤一：创建测试目录和测试文件</h4>



<pre class="wp-block-code"><code># mkdir test
# touch test/test.txt</code></pre>



<p>（补充：这里以创建 test 目录和里面的 test.txt 文件为例）</p>



<h4>步骤二：加密压缩文件或目录<br>2.1 交互式加密压缩文件或目录</h4>



<pre class="wp-block-code"><code># zip -re test1.zip test
Enter password: 
Verify password: 
  adding: test/ (stored 0%)
  adding: test/test.txt (stored 0%)</code></pre>



<p>（补充：这里以将 test 目录和里面的 test.txt 文件加密压缩成 test1.zip （压缩）包为例）</p>



<h4>2.2 非交互式加密解压文件或目录</h4>



<pre class="wp-block-code"><code># zip -rP eternalcenter test2.zip test
  adding: test/ (stored 0%)
  adding: test/test.txt (stored 0%)</code></pre>



<p>（补充：这里以将 test 目录和里面的 test.txt 文件加密压缩成 test2.zip （压缩）包并且将密码设置为 eternalcenter 为例）</p>



<h4>步骤三：解压加密文件或目录<br>3.1 交互式解压加密文件或目录<br>3.1.1 删除原测试目录和里面的文件</h4>



<pre class="wp-block-code"><code># rm -rf test</code></pre>



<p>（补充：这里以删除 test 目录和里面的文件为例）</p>



<h4>3.1.2 交互式解压加密文件或目录</h4>



<pre class="wp-block-code"><code># unzip test2.zip
Archive:  test2.zip
   creating: test/
&#91;test2.zip] test/test.txt password: 
 extracting: test/test.txt</code></pre>



<p>（补充：这里以解压 test2.zip （压缩）包为例）</p>



<h4>3.2 非交互式解压加密文件或目录<br>3.2.1 删除原测试目录和里面的文件</h4>



<pre class="wp-block-code"><code># rm -rf test</code></pre>



<p>（补充：这里以删除 test 目录和里面的文件为例）</p>



<h4>3.2.2 非交互式解压加密文件</h4>



<pre class="wp-block-code"><code># unzip -P eternalcenter test1.zip 
Archive:  test1.zip
   creating: test/
 extracting: test/test.txt  </code></pre>



<p>（补充：这里以解压 test2.zip （压缩）包并且解压密码为 eternalcenter 为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux rm 命令的监控</title>
		<link>https://eternalcenter-2021-12.github.io/rm-monitor/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sun, 07 Nov 2021 13:29:10 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File 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 Setting (系统设置)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=18208</guid>

					<description><![CDATA[步骤一：将原来的 rm 命令进行备份 步骤二：创建一个记录 rm 命令使用的脚本 步骤三：给记录 rm 命令使用的脚本执行权限 步骤四：下次使用 rm 命令后就可以监控 /var/log/rm_command.log 日志了 （步骤略）]]></description>
										<content:encoded><![CDATA[
<h4>步骤一：将原来的 rm 命令进行备份</h4>



<pre class="wp-block-code"><code># cp /usr/bin/rm  /usr/bin/rm.original</code></pre>



<h4>步骤二：创建一个记录 rm 命令使用的脚本</h4>



<pre class="wp-block-code"><code># cat /usr/bin/rm
#!/bin/bash
log=/var/log/rm_command.log
echo "The $$ is calling rm command" &gt;&gt; $log
echo "The full command is $*" &gt;&gt; $log
echo
echo "now use this command to get more information: /bin/ps axwwo user,pid,ppid,%cpu,%mem,vsz,rss,stat,time,cmd" &gt;&gt;$log
/bin/ps axwwo user,pid,ppid,%cpu,%mem,vsz,rss,stat,time,cmd &gt;&gt;$log
/usr/bin/rm.original $*
echo "============================================================" &gt;&gt;$log</code></pre>



<h4>步骤三：给记录 rm 命令使用的脚本执行权限</h4>



<pre class="wp-block-code"><code># chmod 755 /usr/bin/rm.original</code></pre>



<h4>步骤四：下次使用 rm 命令后就可以监控 /var/log/rm_command.log 日志了</h4>



<p>（步骤略）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 批量修改多个远程服务器某一个用户的密码 （精致版）</title>
		<link>https://eternalcenter-2021-12.github.io/shell-password-change-refined-version/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sun, 10 Oct 2021 13:08:50 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Deployment (部署)]]></category>
		<category><![CDATA[Shell Others (其他)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System User (系统用户)]]></category>
		<category><![CDATA[System User & System Privilege (系统用户 & 系统权限)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=18100</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：批量修改多个远程服务器某一个用户的密码作用：批量修改多个远程服务器某一个用户的密码 使用方法：1. 将此脚本和清单 $list 文件放在同一目录下2. 清单 $list 里每服务器名占用一行3. 给脚本分割线里的变量赋值4. 给此脚本添加执行权限5. 执行此脚本 脚本分割线里的变量：1. list=”list.txt” #指定清单的目录和名称2. user=eternalcenter #指定要修改密码的用户3. password=eternalcenter #指定要修改的密码 注意：此脚本执行前必须要先保证执行本脚本的用户能无密码 ssh 远程这些远程服务器，并且可以通过 sudo 获得 su 的 root 权限 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：批量修改多个远程服务器某一个用户的密码<br>作用：批量修改多个远程服务器某一个用户的密码</p>



<p>使用方法：<br>1. 将此脚本和清单 $list 文件放在同一目录下<br>2. 清单 $list 里每服务器名占用一行<br>3. 给脚本分割线里的变量赋值<br>4. 给此脚本添加执行权限<br>5. 执行此脚本</p>



<p>脚本分割线里的变量：<br>1. list=”list.txt” #指定清单的目录和名称<br>2. user=eternalcenter #指定要修改密码的用户<br>3. password=eternalcenter #指定要修改的密码</p>



<p>注意：<br>此脚本执行前必须要先保证执行本脚本的用户能无密码 ssh 远程这些远程服务器，并且可以通过 sudo 获得 su 的 root 权限</p>



<h2>脚本：</h2>



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

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

list="list.txt"
user=eternalcenter
password=eternalcenter

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

num=1

cat $list
for i in `cat $list`
do
        echo $num
        echo $i

	ssh -t $i "type lsb_release" &amp;> /dev/null
        if &#91; $? -ne 0 ]; then
              distribution=`ssh -t $i "cat /etc/*release | grep '^NAME'"`
	      if &#91; $? -ne 0 ];then
		      distribution=`ssh -t $i "cat /etc/*release"`
	      fi
        else
              distribution=`ssh -t $i "lsb_release -i | grep 'ID' | grep -v 'n/a'"`
        fi;

        echo $distribution

	case $distribution in
		*"RedHat"* | *"Red Hat"*)
		ssh -t $i "sudo -u root su - root -c \"echo $password | passwd --stdin $user\""
		if &#91; $? -eq 0 ];then
			echo -e "\033&#91;32m$i is success\033&#91;0m"
		else
			echo -e "\033&#91;31m$i is fail\033&#91;0m"
		fi
		;;

		*"CentOS"*)
		ssh -t $i "sudo -u root su - root -c \"echo $password | passwd --stdin $user\""
		if &#91; $? -eq 0 ];then
			echo -e "\033&#91;32m$i is success\033&#91;0m"
		else
			echo -e "\033&#91;31m$i is fail\033&#91;0m"
		fi
		;;

		*"SUSE"* | *"SLES"*)
		ssh -t $i "sudo -u root su - root -c \"echo $user:$password | chpasswd\""
		if &#91; $? -eq 0 ];then
			echo -e "\033&#91;32m$i is success\033&#91;0m"
		else
			echo -e "\033&#91;31m$i is fail\033&#91;0m"
		fi
		;;
               
		*"openSUSE"*)
		ssh -t $i "sudo -u root su - root -c \"echo $user:$password | chpasswd\""
		if &#91; $? -eq 0 ];then
			echo -e "\033&#91;32m$i is success\033&#91;0m"
		else
			echo -e "\033&#91;31m$i is fail\033&#91;0m"
		fi
		;;

		*)
                echo -e "\033&#91;31m$i is fail \033&#91;0m" 
		;;
        esac

        let num++

        echo
done</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] openSUSE&#038;SUSE 通过 zypper 升级内核保留旧内核数量的设置</title>
		<link>https://eternalcenter-2021-12.github.io/opensusesuse-zypper-kernel-reserve/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 27 Sep 2021 14:06:47 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Patch (系统补丁)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Upgradation (系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=17666</guid>

					<description><![CDATA[将以下内容： 修改为： （补充：这里以使用 zypper 升级内核时保留 3 个 旧内核为例）]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code># vim /etc/zypp/zypp.conf</code></pre>



<p>将以下内容：</p>



<pre class="wp-block-code"><code>......
multiversion.kernels = latest,latest-1,running
......</code></pre>



<p>修改为：</p>



<pre class="wp-block-code"><code>......
multiversion.kernels = latest,latest-3,running
......</code></pre>



<p>（补充：这里以使用 zypper 升级内核时保留 3 个 旧内核为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] CVE 简介</title>
		<link>https://eternalcenter-2021-12.github.io/introduction-to-cve/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 07 Sep 2021 06:09:11 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Patch (系统补丁)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Upgradation (系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=17618</guid>

					<description><![CDATA[内容一：什么叫 CVE CVE 全称是：Common Vulnerabilities and Exposures，翻译成中文是：常见脆弱性和暴露，是一个业界统一的脆弱性和暴露。 内容二：CVE 的常用格式 CVE-2016-4658，其中 2016-4658 是编号 内容三：CVE 的用途 用于标签系统和应用的漏洞，并实现了一个漏洞数据库以进行漏洞的查询和管理 内容四：CVE 的网站 https://www.cvedetails.com]]>/</description>
										<content:encoded><![CDATA[
<h4>内容一：什么叫 CVE</h4>



<p class="has-medium-font-size">CVE 全称是：Common Vulnerabilities and Exposures，翻译成中文是：常见脆弱性和暴露，是一个业界统一的脆弱性和暴露。</p>



<h4>内容二：CVE 的常用格式</h4>



<p class="has-medium-font-size">CVE-2016-4658，其中  2016-4658  是编号</p>



<h4>内容三：CVE 的用途</h4>



<p class="has-medium-font-size">用于标签系统和应用的漏洞，并实现了一个漏洞数据库以进行漏洞的查询和管理</p>



<h4>内容四：CVE 的网站</h4>



<p class="has-medium-font-size">https://www.cvedetails.com/</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] nftables 防火墙的使用 （永久版）</title>
		<link>https://eternalcenter-2021-12.github.io/nfttables-permanent/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 03 Aug 2021 06:28:03 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Firewall (系统防火墙)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=17232</guid>

					<description><![CDATA[注意： 只有 CentOS 8 &#38; RHEL 8 才可以使用 nftables 防火墙 正文： 步骤目录： 步骤一：从 firewalld 防火墙切换至 nftables 防火墙1.1 安装 nftables 防火墙1.2 清空 iptables 防火墙的策略表1.2.1 清空 ipv4 iptables 防火墙的策略表1.2.2 清空 ipv6 iptables 防火墙的策略表1.3 停止使用 firewalld 防火墙1.3.1 取消 firewalld 防火墙开机自启1.3.2 停止 firewalld 防火墙1.4 启用 nftables 防火墙1.4.1 开机自启 nftables 防火墙1.4.2 启动 nftables 防火墙 步骤二：创建永久的 nftales 防火墙的策略表并条件永久的 nftables 防火墙策略2.1 在 &#8230; <p class="link-more"><a href="https://eternalcenter-2021-12.github.io/nfttables-permanent/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] nftables 防火墙的使用 （永久版）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2>注意：</h2>



<p>只有 CentOS 8 &amp; RHEL 8 才可以使用 nftables 防火墙</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2>正文：</h2>



<h2>步骤目录：</h2>



<h4>步骤一：从 firewalld 防火墙切换至 nftables 防火墙<br>1.1 安装 nftables 防火墙<br>1.2 清空 iptables 防火墙的策略表<br>1.2.1 清空 ipv4 iptables 防火墙的策略表<br>1.2.2 清空 ipv6 iptables 防火墙的策略表<br>1.3 停止使用 firewalld 防火墙<br>1.3.1 取消 firewalld 防火墙开机自启<br>1.3.2 停止 firewalld 防火墙<br>1.4 启用 nftables 防火墙<br>1.4.1 开机自启 nftables 防火墙<br>1.4.2 启动 nftables 防火墙</h4>



<h4>步骤二：创建永久的 nftales 防火墙的策略表并条件永久的 nftables 防火墙策略<br>2.1 在 nftables 防火墙的配置文件中添加 nftables 防火墙策略文件<br>2.2 在 nftables 防火墙策略文件中添加 nftables 防火墙策略</h4>



<h2>具体的操作步骤：</h2>



<h4>步骤一：从 firewalld 防火墙切换至 nftables 防火墙<br>1.1 安装 nftables 防火墙</h4>



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



<h4>1.2 清空 iptables 防火墙的策略表<br>1.2.1 清空 ipv4 iptables 防火墙的策略表</h4>



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



<h4>1.2.2 清空 ipv6 iptables 防火墙的策略表</h4>



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



<h4>1.3 停止使用 firewalld 防火墙<br>1.3.1 取消 firewalld 防火墙开机自启</h4>



<pre class="wp-block-code"><code># systemctl disable firewalld.service</code></pre>



<h4>1.3.2 停止 firewalld 防火墙</h4>



<pre class="wp-block-code"><code># systemctl stop firewalld.service</code></pre>



<h4>1.4 启用 nftables 防火墙<br>1.4.1 开机自启 nftables 防火墙</h4>



<pre class="wp-block-code"><code># systemctl enable nftables</code></pre>



<h4>1.4.2 启动 nftables 防火墙</h4>



<pre class="wp-block-code"><code># systemctl start nftables</code></pre>



<h4>步骤二：创建永久的 nftales 防火墙的策略表并条件永久的 nftables 防火墙策略<br>2.1 在 nftables 防火墙的配置文件中添加 nftables 防火墙策略文件</h4>



<pre class="wp-block-code"><code># vi /etc/sysconfig/nftables.conf</code></pre>



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



<pre class="wp-block-code"><code>......
include "/etc/nftables/nftables.rules"</code></pre>



<h4>2.2 在 nftables 防火墙策略文件中添加 nftables 防火墙策略</h4>



<pre class="wp-block-code"><code># vi /etc/nftables/nftables.rules
flush ruleset
table inet siemens_FW {
    chain siemens_FW_input {
      type filter hook input priority 0; policy accept;
      iif "lo" accept
      ip saddr 127.0.0.0/8 counter packets 0 bytes 0 drop
      ip6 saddr ::1 counter packets 0 bytes 0 drop
      ip saddr 192.168.1.1 tcp dport ssh accept                  
      tcp dport ssh drop
    }
    chain siemens_FW_forward {
      type filter hook forward priority 0; policy accept;
    } 
    chain siemens_FW_output {
      type filter hook output priority 0; policy accept;
    }
}</code></pre>



<p>（<br>补充：<br>（1）这里以基本的本地巡回路由策略并禁止除 192.168.1.1 的 IP 地址访问本地的 22 端口为例<br>（2）这里的 /etc/nftables/nftables.rules 是在 2.1 中添加的<br>）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] nftables 防火墙的使用 （临时版）</title>
		<link>https://eternalcenter-2021-12.github.io/nfttables-temporary/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 03 Aug 2021 06:19:08 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Firewall (系统防火墙)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=17229</guid>

					<description><![CDATA[注意： 只有 CentOS 8 &#38; RHEL 8 才可以使用 nftables 防火墙 正文： 步骤目录： 步骤一：从 firewalld 防火墙切换至 nftables 防火墙1.1 安装 nftables 防火墙1.2 清空 iptables 防火墙的策略表1.2.1 清空 ipv4 iptables 防火墙的策略表1.2.2 清空 ipv6 iptables 防火墙的策略表1.3 停止使用 firewalld 防火墙1.3.1 取消 firewalld 防火墙开机自启1.3.2 停止 firewalld 防火墙1.4 启用 nftables 防火墙1.4.1 开机自启 nftables 防火墙1.4.2 启动 nftables 防火墙 步骤二：创建 nftables 防火墙的策略表2.1 创建 nftables 防火墙的策略表2.2 &#8230; <p class="link-more"><a href="https://eternalcenter-2021-12.github.io/nfttables-temporary/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] nftables 防火墙的使用 （临时版）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2>注意：</h2>



<p>只有 CentOS 8 &amp; RHEL 8 才可以使用 nftables 防火墙</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2>正文：</h2>



<h2>步骤目录：</h2>



<h4>步骤一：从 firewalld 防火墙切换至 nftables 防火墙<br>1.1 安装 nftables 防火墙<br>1.2 清空 iptables 防火墙的策略表<br>1.2.1 清空 ipv4 iptables 防火墙的策略表<br>1.2.2 清空 ipv6 iptables 防火墙的策略表<br>1.3 停止使用 firewalld 防火墙<br>1.3.1 取消 firewalld 防火墙开机自启<br>1.3.2 停止 firewalld 防火墙<br>1.4 启用 nftables 防火墙<br>1.4.1 开机自启 nftables 防火墙<br>1.4.2 启动 nftables 防火墙</h4>



<h4>步骤二：创建 nftables 防火墙的策略表<br>2.1 创建 nftables 防火墙的策略表<br>2.2 创建 nftables 防火墙的策略表的 input 链<br>2.3 创建 nftables 防火墙的策略表的 forward 链<br>2.4 创建 nftables 防火墙的策略表的 output 链</h4>



<h4>步骤三：添加临时基本的本地巡回路由策略</h4>



<h2>具体的操作步骤：</h2>



<h4>步骤一：从 firewalld 防火墙切换至 nftables 防火墙<br>1.1 安装 nftables 防火墙</h4>



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



<h4>1.2 清空 iptables 防火墙的策略表<br>1.2.1 清空 ipv4 iptables 防火墙的策略表</h4>



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



<h4>1.2.2 清空 ipv6 iptables 防火墙的策略表</h4>



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



<h4>1.3 停止使用 firewalld 防火墙<br>1.3.1 取消 firewalld 防火墙开机自启</h4>



<pre class="wp-block-code"><code># systemctl disable firewalld.service</code></pre>



<h4>1.3.2 停止 firewalld 防火墙</h4>



<pre class="wp-block-code"><code># systemctl stop firewalld.service</code></pre>



<h4>1.4 启用 nftables 防火墙<br>1.4.1 开机自启 nftables 防火墙</h4>



<pre class="wp-block-code"><code># systemctl enable nftables</code></pre>



<h4>1.4.2 启动 nftables 防火墙</h4>



<pre class="wp-block-code"><code># systemctl start nftables</code></pre>



<h4>步骤二：创建 nftables 防火墙的策略表<br>2.1 创建 nftables 防火墙的策略表</h4>



<pre class="wp-block-code"><code># nft create table inet &lt;tablename&gt;</code></pre>



<h4>2.2 创建 nftables 防火墙的策略表的 input 链</h4>



<pre class="wp-block-code"><code># nft create chain inet &lt;tablename&gt; input { type filter hook input priority 0 \; }</code></pre>



<h4>2.3 创建 nftables 防火墙的策略表的 forward 链</h4>



<pre class="wp-block-code"><code># nft create chain inet &lt;tablename&gt; forward { type filter hook forward priority 0 \; }</code></pre>



<h4>2.4 创建 nftables 防火墙的策略表的 output 链</h4>



<pre class="wp-block-code"><code># nft create chain inet &lt;tablename&gt; output { type filter hook output priority 0 \; }</code></pre>



<h4>步骤三：添加临时基本的本地巡回路由策略</h4>



<pre class="wp-block-code"><code># nft add rule inet filter input iif lo accept
# nft add rule inet filter input ip saddr 127.0.0.0/8 counter drop
# nft add rule inet filter input ip6 saddr ::1 counter drop</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux 全局加密 SSL 的设置 （CentOS 8 &#038; RHEL 8 版）</title>
		<link>https://eternalcenter-2021-12.github.io/global-ssl-centos8rhel8/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 31 Jul 2021 10:11:21 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network (系统网络)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Patch (系统补丁)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Software (系统软件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=17184</guid>

					<description><![CDATA[步骤一：查看当前 SSL 全局加密 SSL 的状况 （补充：这里的 DEFAULT 表示可以使用 2048 位及以上位数的 SSL） 步骤二：切换当前 SSL 全局加密 SSL （补充：1) 这里以将全局加密 SSL 切换到 FUTURE 状态为例2) 此时只能使用 4096 位及以上位数的 SSL）]]></description>
										<content:encoded><![CDATA[
<h4>步骤一：查看当前 SSL 全局加密 SSL 的状况</h4>



<pre class="wp-block-code"><code># update-crypto-policies --show
DEFAULT</code></pre>



<p>（补充：这里的 DEFAULT 表示可以使用 2048 位及以上位数的 SSL）</p>



<h4>步骤二：切换当前 SSL 全局加密 SSL</h4>



<pre class="wp-block-code"><code># update-crypto-policies --set FUTURE</code></pre>



<p>（<br>补充：<br>1) 这里以将全局加密 SSL 切换到 FUTURE 状态为例<br>2) 此时只能使用 4096 位及以上位数的 SSL<br>）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux 输错密码次数限制的设置 （CentOS&#038;RHEL 版）</title>
		<link>https://eternalcenter-2021-12.github.io/password-attempt-centosrhel/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 31 Jul 2021 09:48:09 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=17171</guid>

					<description><![CDATA[步骤一：生成设置密码必须包含大小写字母的策略文件 （注意：如果没有 custom/password-policy 文件则进行以下操作： ） 步骤二：配置 /etc/authselect/custom/password-policy/system-auth 文件 先删除包含以下内容的行： 再将以下内容： 修改为： （补充：这里的 retry=5 代表重复尝试 5 次后登陆会被锁住） 步骤三：配置 /etc/authselect/custom/password-policy/system-password 文件 先删除包含以下内容的行： 再将以下内容： 修改为： （补充：这里的 retry=5 代表重复尝试 5 次后登陆会被锁住） 步骤四：配置 /etc/security/faillock.conf 文件 将以下内容： 修改为： （补充：这里的 deny = 30 和 unlock_time = 600 代表拒绝 30 次 600 秒后解锁）]]></description>
										<content:encoded><![CDATA[
<h4>步骤一：生成设置密码必须包含大小写字母的策略文件</h4>



<pre class="wp-block-code"><code># authselect list
- nis                            Enable NIS for system authentication
- sssd                           Enable SSSD for system authentication (also for local users only)
- winbind                        Enable winbind for system authentication
- custom/password-policy         Enable SSSD for system authentication (also for local users only)</code></pre>



<p>（<br>注意：如果没有 custom/password-policy 文件则进行以下操作：</p>



<pre class="wp-block-code"><code># authselect create-profile password-policy -b sssd --symlink-meta --symlink-pam
# authselect select custom/password-policy
# authselect current
Profile ID: custom/password-policy
Enabled features: None</code></pre>



<p>）</p>



<h4>步骤二：配置  /etc/authselect/custom/password-policy/system-auth 文件</h4>



<pre class="wp-block-code"><code># vim /etc/authselect/custom/password-policy/system-auth</code></pre>



<p>先删除包含以下内容的行：</p>



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



<p>再将以下内容：</p>



<pre class="wp-block-code"><code>......
password    requisite                                    pam_pwquality.so try_first_pass local_users_only
......
auth        required                                     pam_faillock.so preauth silent                         {include if "with-faillock"}
......
auth        required                                     pam_faillock.so authfail                               {include if "with-faillock"}
......</code></pre>



<p>修改为：</p>



<pre class="wp-block-code"><code>......
password    requisite                                    pam_pwquality.so try_first_pass local_users_only retry=5
......
auth        required                                     pam_faillock.so preauth
......
auth        required                                     pam_faillock.so authfail
......</code></pre>



<p>（补充：这里的 retry=5 代表重复尝试 5 次后登陆会被锁住）</p>



<h4> 步骤三：配置  /etc/authselect/custom/password-policy/system-password 文件 </h4>



<pre class="wp-block-code"><code># vim /etc/authselect/custom/password-policy/system-password</code></pre>



<p>先删除包含以下内容的行：</p>



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



<p> 再将以下内容： </p>



<pre class="wp-block-code"><code>......
password    requisite                                    pam_pwquality.so try_first_pass local_users_only
......
auth        required                                     pam_faillock.so preauth silent                         {include if "with-faillock"}
......
auth        required                                     pam_faillock.so authfail                               {include if "with-faillock"}
......</code></pre>



<p> 修改为： </p>



<pre class="wp-block-code"><code>......
password    requisite                                    pam_pwquality.so try_first_pass local_users_only retry=5
......
auth        required                                     pam_faillock.so preauth
......
auth        required                                     pam_faillock.so authfail
......</code></pre>



<p> （补充：这里的 retry=5 代表重复尝试 5 次后登陆会被锁住） </p>



<h4>步骤四：配置 /etc/security/faillock.conf 文件</h4>



<p>将以下内容：</p>



<pre class="wp-block-code"><code>......
# deny = 3
......
# unlock_time = 600
......</code></pre>



<p>修改为：</p>



<pre class="wp-block-code"><code>......
deny = 30
......
unlock_time = 600
......</code></pre>



<p>（补充：这里的  deny = 30  和  unlock_time = 600 代表拒绝 30 次 600 秒后解锁）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 批量修改多个远程服务器某一个用户的密码 （简单版）</title>
		<link>https://eternalcenter-2021-12.github.io/shell-password-change-simple-version/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 09 Jun 2021 10:37:59 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Deployment (部署)]]></category>
		<category><![CDATA[Shell Others (其他)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System User (系统用户)]]></category>
		<category><![CDATA[System User & System Privilege (系统用户 & 系统权限)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=14638</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：批量修改多个远程服务器某一个用户的密码作用：批量修改多个远程服务器某一个用户的密码，并查看密码更新时间 使用方法：1. 将此脚本和清单 $list 文件放在同一目录下2. 清单 $list 里每服务器名占用一行3. 给脚本分割线里的变量赋值4. 给此脚本添加执行权限5. 执行此脚本 脚本分割线里的变量：1. list=&#8221;list.txt&#8221; #指定清单的目录和名称2. user=eternalcenter #指定要修改密码的用户3. password=eternalcenter #指定要修改的密码 注意：此脚本执行前必须要先保证执行本脚本的用户能无密码 ssh 远程这些远程服务器，并且可以通过 sudo 获得 su 的 root 权限 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：批量修改多个远程服务器某一个用户的密码<br>作用：批量修改多个远程服务器某一个用户的密码，并查看密码更新时间</p>



<p>使用方法：<br>1. 将此脚本和清单 $list 文件放在同一目录下<br>2. 清单 $list 里每服务器名占用一行<br>3. 给脚本分割线里的变量赋值<br>4. 给此脚本添加执行权限<br>5. 执行此脚本</p>



<p>脚本分割线里的变量：<br>1. list=&#8221;list.txt&#8221; #指定清单的目录和名称<br>2. user=eternalcenter #指定要修改密码的用户<br>3. password=eternalcenter #指定要修改的密码</p>



<p>注意：<br>此脚本执行前必须要先保证执行本脚本的用户能无密码 ssh 远程这些远程服务器，并且可以通过 sudo 获得 su 的 root 权限</p>



<h2>脚本：</h2>



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

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

list="list.txt"
user=eternalcenter
password=eternalcenter

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

num=1

cat $list
for i in `cat $list`
do
        echo $num
        echo $i
        ssh -t $i "sudo -u root su - root -c \"echo $password | passwd --stdin $user\""
        ssh -t $i "sudo -u root su - root -c \"echo $user:$password | chpasswd\""
        ssh -t $i sudo -u root su - root -c \"chage -l $user\"
        let num++

        echo
done</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] SELinux  的启用 （openSUSE&#038;SUSE  版） （不建议）</title>
		<link>https://eternalcenter-2021-12.github.io/selinux-opensusesuse/</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-2021-12.github.io/?p=14516</guid>

					<description><![CDATA[软件准备： 在 SELinuxProject 的官网上下载 SELinux 策略 UseRefpolicy： https://github.com/SELinuxProject/refpolicy/wiki/UseRefpolicy 注意： 1) 如果使用此文的方法将 openSUSE&#38;SUSE 的 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 策略的压缩包2.2 将 SELinux 策略移动到 SELinux 配置文件的位置2.3 &#8230; <p class="link-more"><a href="https://eternalcenter-2021-12.github.io/selinux-opensusesuse/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] SELinux  的启用 （openSUSE&#038;SUSE  版） （不建议）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2>软件准备：</h2>



<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>



<h2>注意：</h2>



<p>1) 如果使用此文的方法将 openSUSE&amp;SUSE 的 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>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2>正文：</h2>



<h2>步骤目录：</h2>



<h4>步骤一：安装 SELinux 组件</h4>



<h4>步骤二：安装 SELinux 策略<br>2.1 解压包含 SELinux 策略的压缩包<br>2.2 将 SELinux 策略移动到 SELinux 配置文件的位置<br>2.3 进入到和 SELinux 策略相同目录下<br>2.4 查看 SELinux 策略的安装手册<br>2.5 创建 SELinux 策略的配置文件<br>2.6 创建 SELinux 策略<br>2.7 编译 SELinux 策略<br>2.8 安装 SELinux 策略</h4>



<h4>步骤三：配置 SELinux 配置文件<br>3.1 在 SELinux 配置文件中将 SELinux 设置为 Permissive 状态<br>3.2 在系统内核中禁止使用 AppArmor 使用 SELinux 并且将 SELinux状态设置为 Permissive<br>3.2.1 设置 grub 文件<br>3.2.2 让刚刚设置的 grub 文件生效<br>3.3 刷新系统内所有文件的标签</h4>



<h4>步骤四：重启系统让 SELinux 生效</h4>



<h2>具体的操作步骤：</h2>



<h4>步骤一：安装 SELinux 组件</h4>



<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>



<h4>步骤二：安装 SELinux 策略<br>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>2.2 将 SELinux 策略移动到 SELinux 配置文件的位置</h4>



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



<h4>2.3 进入到和 SELinux 策略相同目录下</h4>



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



<h4>2.4 查看 SELinux 策略的安装手册</h4>



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



<h4>2.5 创建 SELinux 策略的配置文件</h4>



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



<h4>2.6 创建 SELinux 策略</h4>



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



<h4>2.7 编译 SELinux 策略</h4>



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



<h4>2.8 安装 SELinux 策略</h4>



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



<h4>步骤三：配置 SELinux 配置文件<br>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>3.2 在系统内核中禁止使用 AppArmor 使用 SELinux 并且将 SELinux状态设置为 Permissive<br>3.2.1 设置 grub 文件</h4>



<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>



<h4>3.2.2 让刚刚设置的 grub 文件生效</h4>



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



<h4>3.3 刷新系统内所有文件的标签</h4>



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



<h4>步骤四：重启系统让 SELinux 生效</h4>



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



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



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



<p class="has-text-align-center">https://documentation.suse.com/sles/15-SP2/html/SLES-all/cha-selinux.html</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux SELinux 状态的设置</title>
		<link>https://eternalcenter-2021-12.github.io/selinux-state/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 31 May 2021 13:37:41 +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-2021-12.github.io/?p=14456</guid>

					<description><![CDATA[内容目录： 内容一：SELinux 的状态 内容二：永久切换 SELinux 状态2.1 将 SELinux 永久切换至 Disabled 状态2.1.1 修改 SELinux 配置文件2.1.2 重启系统2.1.3 查看 SELinux 状态2.2 将 SELinux 永久切换至 Permissive 状态2.2.1 修改 SELinux 配置文件2.2.2 重启系统2.2.3 查看 SELinux 状态2.3 将 SELinux 永久切换至 Enforcing 状态2.3.1 修改 SELinux 配置文件2.3.2 重启系统2.3.3 查看 SELinux 状态 内容三：临时切换 SELinux 状态3.1 临时切换到 Permissive 状态3.1.1 临时切换到 Permissive 状态3.1.2 查看 SELinux 状态3.2 临时切换到 &#8230; <p class="link-more"><a href="https://eternalcenter-2021-12.github.io/selinux-state/" class="more-link">Continue reading<span class="screen-reader-text"> "[内容] Linux SELinux 状态的设置"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2>内容目录：</h2>



<h4>内容一：SELinux 的状态</h4>



<h4>内容二：永久切换 SELinux 状态<br>2.1 将 SELinux 永久切换至 Disabled 状态<br>2.1.1 修改 SELinux 配置文件<br>2.1.2 重启系统<br>2.1.3 查看 SELinux 状态<br>2.2 将 SELinux 永久切换至 Permissive 状态<br>2.2.1 修改 SELinux 配置文件<br>2.2.2 重启系统<br>2.2.3 查看 SELinux 状态<br>2.3 将 SELinux 永久切换至 Enforcing 状态<br>2.3.1 修改 SELinux 配置文件<br>2.3.2 重启系统<br>2.3.3 查看 SELinux 状态</h4>



<h4>内容三：临时切换 SELinux 状态<br>3.1 临时切换到 Permissive 状态<br>3.1.1 临时切换到 Permissive 状态<br>3.1.2 查看 SELinux 状态<br>3.2 临时切换到 Enforcing 状态<br>3.2.1 临时切换到 Enforcing 状态<br>3.2.2 查看 SELinux 状态</h4>



<h2>具体的内容：</h2>



<h4>内容一：SELinux 的状态</h4>



<p>1) Disabled：完全关闭 SELinux<br>2) Permissive：即使违反了策略也依旧可以执行，但是违反策略的记录会被记录在日志中<br>3) Enforcing：如果违反了策略就不能之行</p>



<h4>内容二：永久切换 SELinux 状态<br>2.1 将 SELinux 永久切换至 Disabled 状态<br>2.1.1 修改 SELinux 配置文件</h4>



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



<p>将以下内容：</p>



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



<p>修改为：</p>



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



<h4>2.1.2 重启系统</h4>



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



<h4>2.1.3 查看 SELinux 状态</h4>



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



<h4>2.2 将 SELinux 永久切换至 Permissive 状态<br>2.2.1 修改 SELinux 配置文件</h4>



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



<p>将以下内容：</p>



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



<p>修改为：</p>



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



<h4>2.2.2 重启系统</h4>



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



<h4>2.2.3 查看 SELinux 状态</h4>



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



<h4>2.3 将 SELinux 永久切换至 Enforcing 状态<br>2.3.1 修改 SELinux 配置文件</h4>



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



<p>将以下内容：</p>



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



<p>修改为：</p>



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



<h4>2.3.2 重启系统</h4>



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



<h4>2.3.3 查看 SELinux 状态</h4>



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



<h4>内容三：临时切换 SELinux 状态<br>3.1 临时切换到 Permissive 状态<br>3.1.1 临时切换到 Permissive 状态</h4>



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



<p>（<br>注意：<br>1) 系统重启后失效<br>2) 只能从 Enforcing 状态切换到 Permissive 状态<br>）</p>



<h4>3.1.2 查看 SELinux 状态</h4>



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



<h4>3.2 临时切换到 Enforcing 状态<br>3.2.1 临时切换到 Enforcing 状态</h4>



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



<p>（<br>注意：<br>1) 系统重启后失效<br>2) 只能从 Permissive 状态切换到 Enforcing 状态<br>）</p>



<h4>3.2.2 查看 SELinux 状态</h4>



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



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 检测服务器某个端口有没有启动</title>
		<link>https://eternalcenter-2021-12.github.io/shell-port-check/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 18 May 2021 06:23:57 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network (系统网络)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Port Security (系统端口安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=14314</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：检测服务器某个端口有没有启动作用：检测服务器某个端口有没有启动 使用方法：1. 在此脚本的分割线内写入相应的内容2. 给此脚本添加执行权限3. 执行此脚本4. 如果被检测的端口被启动则会被记录在指定文件里 脚本分割线里的变量：1. checkport=&#8217;7111&#8242; #被检测的端口2. logfile=&#8217;checkportlog.txt&#8217; #记录文件 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：检测服务器某个端口有没有启动<br>作用：检测服务器某个端口有没有启动</p>



<p>使用方法：<br>1. 在此脚本的分割线内写入相应的内容<br>2. 给此脚本添加执行权限<br>3. 执行此脚本<br>4. 如果被检测的端口被启动则会被记录在指定文件里</p>



<p>脚本分割线里的变量：<br>1. checkport=&#8217;7111&#8242; #被检测的端口<br>2. logfile=&#8217;checkportlog.txt&#8217; #记录文件</p>



<h2>脚本：</h2>



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

####################### Separator ########################
checkport='7111'
logfile='checkportlog.txt'
####################### Separator ########################

a=`/sbin/ss -ntulap | grep udp | grep $checkport | awk '{print $7}' | awk -F'"' '{print $2}'`

if &#91; -n "$a" ];then
       echo `date` >> $logfile
       echo $checkport >> $logfile
       echo `/sbin/ss -ntulap | grep udp | grep $checkport | awk '{print $7}' | awk -F'"' '{print $2}'` >> $logfile
       echo >> $logfile
fi</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux ssh 登陆提示信息的修改</title>
		<link>https://eternalcenter-2021-12.github.io/banner-ssh/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 11 May 2021 09:17:51 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></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 Setting (系统设置)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=14227</guid>

					<description><![CDATA[步骤一：修改 sshd 的配置 将以下内容： 修改为： 或者： （补充：这里以将 ssh 登陆提示信息修改为 eternalcenter 为例） 步骤二：重启 sshd 服务]]></description>
										<content:encoded><![CDATA[
<h4>步骤一：修改 sshd 的配置</h4>



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



<p>将以下内容：</p>



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



<p>修改为：</p>



<pre class="wp-block-code"><code>Banner eternalcenter</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># sed -i 's/.*Banner.*/Banner eternalcenter/' /etc/ssh/sshd_config</code></pre>



<p>（补充：这里以将 ssh 登陆提示信息修改为 eternalcenter 为例）</p>



<h4>步骤二：重启 sshd 服务</h4>



<pre class="wp-block-code"><code># systemctl restart sshd</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 本地登陆提示信息的修改 （openSUSE&#038;SUSE 版）</title>
		<link>https://eternalcenter-2021-12.github.io/banner-local/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 11 May 2021 03:26:28 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></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 Setting (系统设置)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=14223</guid>

					<description><![CDATA[内容目录： 内容一：openSUSE 15.0、openSUSE 15.1、openSUSE 15.2 和 SUSE 12.X 修改本地登陆提示信息 内容二：openSUSE 15.3 及以上版本修改本地登陆提示信息2.1 修改本地登陆系统方面的提示信息2.2 去除本地登陆网卡方面的提示信息2.2.1 去除现有的网卡提示信息2.2.2 设置不再新生成网卡提示信息2.2.3 追加本地登陆提示信息 内容三：SUSE 15.X 修改本地登陆提示信息3.1 修改本地登陆系统方面的提示信息3.2 去除本地登陆网卡方面的提示信息3.2.1 去除现有的网卡提示信息3.2.2 设置不再新生成网卡提示信息3.2.3 设置不再新生成网卡提示信息 具体的内容： 内容一：openSUSE 15.0、openSUSE 15.1、openSUSE 15.2 和 SUSE 12.X 修改本地登陆提示信息 （补充：这里以将本地登陆提示信息修改为 eternalcenter.com 为例） 内容二：openSUSE 15.3 及以上版本修改本地登陆提示信息2.1 修改本地登陆系统方面的提示信息 2.2 去除本地登陆网卡方面的提示信息2.2.1 去除现有的网卡提示信息 2.2.2 设置不再新生成网卡提示信息 将以下内容： 修改为： 或者： （补充：1) 这里以将本地登陆提示信息修改为 eternalcenter.com 为例2) 将 NETWORK_INTERFACE_REGEX=&#8221;^[be]&#8221; &#8230; <p class="link-more"><a href="https://eternalcenter-2021-12.github.io/banner-local/" class="more-link">Continue reading<span class="screen-reader-text"> "[内容] Linux 本地登陆提示信息的修改 （openSUSE&#038;SUSE 版）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2>内容目录：</h2>



<h4>内容一：openSUSE 15.0、openSUSE 15.1、openSUSE 15.2 和 SUSE 12.X 修改本地登陆提示信息</h4>



<h4>内容二：openSUSE 15.3 及以上版本修改本地登陆提示信息<br>2.1 修改本地登陆系统方面的提示信息<br>2.2 去除本地登陆网卡方面的提示信息<br>2.2.1 去除现有的网卡提示信息<br>2.2.2 设置不再新生成网卡提示信息<br>2.2.3 追加本地登陆提示信息</h4>



<h4>内容三：SUSE 15.X 修改本地登陆提示信息<br>3.1 修改本地登陆系统方面的提示信息<br>3.2 去除本地登陆网卡方面的提示信息<br>3.2.1 去除现有的网卡提示信息<br>3.2.2 设置不再新生成网卡提示信息<br>3.2.3 设置不再新生成网卡提示信息</h4>



<h2>具体的内容：</h2>



<h4>内容一：openSUSE 15.0、openSUSE 15.1、openSUSE 15.2 和 SUSE 12.X 修改本地登陆提示信息</h4>



<pre class="wp-block-code"><code># echo 'eternalcenter.com' &gt; /etc/issue
# echo 'eternalcenter.com' &gt; /etc/issue.net</code></pre>



<p>（补充：这里以将本地登陆提示信息修改为 eternalcenter.com 为例）</p>



<h4>内容二：openSUSE 15.3 及以上版本修改本地登陆提示信息<br>2.1 修改本地登陆系统方面的提示信息</h4>



<pre class="wp-block-code"><code># echo 'eternalcenter' &gt; /usr/lib/issue.d/10-openSUSE.conf</code></pre>



<h4>2.2 去除本地登陆网卡方面的提示信息<br>2.2.1 去除现有的网卡提示信息</h4>



<pre class="wp-block-code"><code># issue-generator network remove eth0</code></pre>



<h4>2.2.2 设置不再新生成网卡提示信息</h4>



<pre class="wp-block-code"><code># vim /etc/sysconfig/issue-generator</code></pre>



<p>将以下内容：</p>



<pre class="wp-block-code"><code>......
NETWORK_INTERFACE_REGEX="^&#91;be]"
......</code></pre>



<p>修改为：</p>



<pre class="wp-block-code"><code>......
NETWORK_INTERFACE_REGEX="^&#91;b]"
......</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># sed -i 's/NETWORK_INTERFACE_REGEX="^\&#91;be\]"/NETWORK_INTERFACE_REGEX="^\&#91;b\]"/' /etc/sysconfig/issue-generator</code></pre>



<p>（<br>补充：<br>1) 这里以将本地登陆提示信息修改为 eternalcenter.com 为例<br>2) 将 NETWORK_INTERFACE_REGEX=&#8221;^[be]&#8221; 修改为 NETWORK_INTERFACE_REGEX=&#8221;^[b]&#8221; 是不再显示网卡信息<br>）</p>



<h4>2.2.3 追加本地登陆提示信息</h4>



<pre class="wp-block-code"><code># echo 'Welcome' /etc/issue.d/issue</code></pre>



<p>（<br>补充：<br>1) 这里以添加 Welcome 本地登陆提示信息为例<br>2) 结合上文的案例，这里将同时显示 eternalcenter.com 和 Welcome<br>）</p>



<h4>内容三：SUSE 15.X 修改本地登陆提示信息<br>3.1 修改本地登陆系统方面的提示信息</h4>



<pre class="wp-block-code"><code># echo 'eternalcenter' &gt; /usr/lib/issue.d/10-SUSE</code></pre>



<h4>3.2 去除本地登陆网卡方面的提示信息<br>3.2.1 去除现有的网卡提示信息</h4>



<pre class="wp-block-code"><code># issue-generator network remove eth0</code></pre>



<h4>3.2.2 设置不再新生成网卡提示信息</h4>



<pre class="wp-block-code"><code># vim /etc/sysconfig/issue-generator</code></pre>



<p>将以下内容：</p>



<pre class="wp-block-code"><code>......
NETWORK_INTERFACE_REGEX="^&#91;be]"
......</code></pre>



<p>修改为：</p>



<pre class="wp-block-code"><code>......
NETWORK_INTERFACE_REGEX="^&#91;b]"
......</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># sed -i 's/NETWORK_INTERFACE_REGEX="^\&#91;be\]"/NETWORK_INTERFACE_REGEX="^\&#91;b\]"/' /etc/sysconfig/issue-generator</code></pre>



<p>（<br>补充：<br>1) 这里以将本地登陆提示信息修改为 eternalcenter.com 为例<br>2) 将 NETWORK_INTERFACE_REGEX=”^[be]” 修改为 NETWORK_INTERFACE_REGEX=”^[b]” 是不再显示网卡信息<br>）</p>



<h4>3.2.3 追加本地登陆提示信息</h4>



<pre class="wp-block-code"><code># echo 'Welcome' /etc/issue.d/issue</code></pre>



<p>（<br>补充：<br>1) 这里以添加 Welcome 本地登陆提示信息为例<br>2) 结合上文的案例，这里将同时显示 eternalcenter.com 和 Welcome<br>）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux SSL 证书的生成 （openssl 版）</title>
		<link>https://eternalcenter-2021-12.github.io/ssl-openssl/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 20 Apr 2021 07:50:42 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Basic Guidelines for Website building (网站建设基础指南)]]></category>
		<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Django Service (服务)]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Nginx Security (安全)]]></category>
		<category><![CDATA[Personal Website Building (个人网站建设)]]></category>
		<category><![CDATA[Project (项目)]]></category>
		<category><![CDATA[Services (服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Port Security (系统端口安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[Website Services (网站服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=14032</guid>

					<description><![CDATA[内容一：生成 SSL 证书1.1 交互式生成 SSL 证书 （补充：这里以同时生成长度 4096 位，加密格式为 512 的私钥 eternalcenter.com.key 和公钥 eternalcenter.com.csr 为例） 1.2 非交互式生成 SSL 证书 （补充：这里以同时生成1) 长度为 4096 位2) 加密格式为 5123) 国家为 CN4) 州或省为 Sichuan5) 城市为 Chengdu6) 组织为 Eternal Center7) 部门为 Mingyu Zhu8) 域名为 eternalcenter.com9) 邮箱地址为 contact@mingyuzhu.com的私钥 eternalcenter.com.key 和公钥 eternalcenter.com.csr 为例） 内容二：测试 SSL 证书]]></description>
										<content:encoded><![CDATA[
<h4>内容一：生成 SSL 证书<br>1.1 交互式生成 SSL 证书</h4>



<pre class="wp-block-code"><code># openssl req -nodes -newkey rsa:4096 -sha512 -keyout eternalcenter.com.key -out eternalcenter.com.csr</code></pre>



<p>（补充：这里以同时生成长度 4096 位，加密格式为 512 的私钥 eternalcenter.com.key 和公钥 eternalcenter.com.csr 为例）</p>



<h4>1.2 非交互式生成 SSL 证书</h4>



<pre class="wp-block-code"><code># openssl req -nodes -newkey rsa:4096 -sha512 -out eternalcenter.com.csr -keyout eternalcenter.com.key -subj "/C=CN/ST=Sichuan/L=Chengdu/O=Eternal Center/OU=Mingyu Zhu/CN=eternalcenter.com/emailAddress=contact@mingyuzhu.com"</code></pre>



<p>（<br>补充：这里以同时生成<br>1) 长度为 4096 位<br>2) 加密格式为 512<br>3) 国家为 CN<br>4) 州或省为 Sichuan<br>5) 城市为 Chengdu<br>6) 组织为 Eternal Center<br>7) 部门为 Mingyu Zhu<br>8) 域名为 eternalcenter.com<br>9) 邮箱地址为 contact@mingyuzhu.com<br>的私钥 eternalcenter.com.key 和公钥 eternalcenter.com.csr 为例<br>）</p>



<h4>内容二：测试 SSL 证书</h4>



<pre class="wp-block-code"><code># openssl req -in eternalcenter.com.csr -noout -text</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux 输错密码次数限制的设置 （openSUSE&#038;SUSE 版）</title>
		<link>https://eternalcenter-2021-12.github.io/password-attempt-opensusesuse/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 20 Mar 2021 12:00:54 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=13629</guid>

					<description><![CDATA[步骤一：配置 /etc/pam.d/sshd 文件 （补充：1) 这里的 pam_tally2.so 代表使用 pam_tally2.so 模块2) 这里的 deny=15 代表输错 15 次后会禁止登陆3) 这里的 unlock_time=3000 代表禁止登陆后 3000 毫秒后可以重新登陆） 步骤二：配置 /etc/pam.d/sshd 文件 （补充：这里的 pam_tally2.so 代表加载 pam_tally2.so 模块）]]></description>
										<content:encoded><![CDATA[
<h4>步骤一：配置 /etc/pam.d/sshd 文件</h4>



<pre class="wp-block-code"><code># sed -i '/auth.*include.*common-auth/a auth      required   pam_tally2.so onerr=fail audit silent deny=15 unlock_time=3000' /etc/pam.d/sshd</code></pre>



<p>（<br>补充：<br>1) 这里的 pam_tally2.so 代表使用 pam_tally2.so 模块<br>2) 这里的 deny=15 代表输错 15 次后会禁止登陆<br>3) 这里的 unlock_time=3000 代表禁止登陆后 3000 毫秒后可以重新登陆<br>）</p>



<h4>步骤二：配置 /etc/pam.d/sshd 文件</h4>



<pre class="wp-block-code"><code># sed -i '/account.*include.*common-account/a account     required    pam_tally2.so' /etc/pam.d/sshd</code></pre>



<p>（补充：这里的 pam_tally2.so 代表加载 pam_tally2.so 模块）</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
