<?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 Computer &amp; System Hardware &amp; System Installation &amp; System Upgradation (系统电脑 &amp; 系统硬件 &amp; 系统安装 &amp; 系统升级) &#8211; Eternal Center</title>
	<atom:link href="https://eternalcenter-2021-12.github.io/category/system/system-computer-system-hardware-system-installation-system-upgradation/feed/" rel="self" type="application/rss+xml" />
	<link>https://eternalcenter-2021-12.github.io/</link>
	<description></description>
	<lastBuildDate>Sun, 26 Dec 2021 09:03:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>[步骤] 系统升级 （从 openSUSE Leap 15.2 升级到 openSUSE Leap 15.3）</title>
		<link>https://eternalcenter-2021-12.github.io/upgrade-opensuse-leap-15-3/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sun, 03 Oct 2021 14:46:19 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Upgradation (系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=17771</guid>

					<description><![CDATA[步骤目录： 步骤一：查看现在的系统版本 步骤二：准备升级2.1 确认已使用的软件库2.2 刷新已使用的软件库2.3 升级到 openSUSE Leap 15.22.4 用 releasever 变量替换所有版本号 步骤三：升级系统3.1 将版本号设置为 15.3 并刷新3.2 提前下载并安装 openSUSE Leap 15.3 所需的软件包3.3 升级系统3.4 重启系统 步骤四：后续检查4.1 查看升级后的系统版本4.2 查看升级后已使用的软件库 具体的操作步骤： 步骤一：查看现在的系统版本 （注意：确保显示的系统版本是 openSUSE Leap 15.2） 步骤二：准备升级2.1 确认已使用的软件库 （补充：确保以上库已处于 Enabled 状态） 2.2 刷新已使用的软件库 （注意：确保刷新成功，否则请检查网络） 2.3 升级到 openSUSE Leap 15.2 2.4 用 releasever 变量替换所有版本号 步骤三：升级系统3.1 将版本号设置为 15.3 并刷新 3.2 提前下载并安装 &#8230; <p class="link-more"><a href="https://eternalcenter-2021-12.github.io/upgrade-opensuse-leap-15-3/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] 系统升级 （从 openSUSE Leap 15.2 升级到 openSUSE Leap 15.3）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2>步骤目录：</h2>



<h4>步骤一：查看现在的系统版本</h4>



<h4>步骤二：准备升级<br>2.1 确认已使用的软件库<br>2.2 刷新已使用的软件库<br>2.3 升级到 openSUSE Leap 15.2<br>2.4 用 releasever 变量替换所有版本号</h4>



<h4>步骤三：升级系统<br>3.1 将版本号设置为 15.3 并刷新<br>3.2 提前下载并安装 openSUSE Leap 15.3 所需的软件包<br>3.3 升级系统<br>3.4 重启系统</h4>



<h4>步骤四：后续检查<br>4.1 查看升级后的系统版本<br>4.2 查看升级后已使用的软件库</h4>



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



<h4>步骤一：查看现在的系统版本</h4>



<pre class="wp-block-code"><code># cat /etc/*release*
NAME="openSUSE Leap"
VERSION="15.2"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.2"
PRETTY_NAME="openSUSE Leap 15.2"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.2"
BUG_REPORT_URL="https://bugs.opensuse.org/"
HOME_URL="https://www.opensuse.org/"</code></pre>



<p>（注意：确保显示的系统版本是 openSUSE Leap 15.2）</p>



<h4>步骤二：准备升级<br>2.1 确认已使用的软件库</h4>



<pre class="wp-block-code"><code># zypper ls -d
#  | Alias                     | Name                               | Enabled | GPG Check | Refresh | Priority | Type   | URI
---+---------------------------+------------------------------------+---------+-----------+---------+----------+--------+---------------------------------------------------------------------------------------------
1  | repo-non-oss              | Non-OSS Repository                 | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.2/repo/non-oss/
2  | repo-oss                  | Main Repository                    | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.2/repo/oss/
3 | repo-update               | Main Update Repository             | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.2/oss/
4 | repo-update-non-oss       | Update Repository (Non-Oss)        | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.2/non-oss/</code></pre>



<p>（补充：确保以上库已处于 Enabled 状态）</p>



<h4>2.2 刷新已使用的软件库</h4>



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



<p>（注意：确保刷新成功，否则请检查网络）</p>



<h4>2.3 升级到 openSUSE Leap 15.2</h4>



<pre class="wp-block-code"><code># zypper -n update</code></pre>



<h4>2.4 用 releasever 变量替换所有版本号</h4>



<pre class="wp-block-code"><code># sed -i 's/15.2/${releasever}/g' /etc/zypp/repos.d/*.repo</code></pre>



<h4>步骤三：升级系统<br>3.1 将版本号设置为 15.3 并刷新</h4>



<pre class="wp-block-code"><code># zypper --releasever=15.3 refresh</code></pre>



<h4>3.2 提前下载并安装 openSUSE Leap 15.3 所需的软件包</h4>



<pre class="wp-block-code"><code># zypper --releasever=15.3 dup --download-in-advance</code></pre>



<h4>3.3 升级系统</h4>



<pre class="wp-block-code"><code># zypper --releasever=15.3 dup</code></pre>



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



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



<h4>步骤四：后续检查<br>4.1 查看升级后的系统版本</h4>



<pre class="wp-block-code"><code># cat /etc/*release*
NAME="openSUSE Leap"
VERSION="15.3"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.3"
PRETTY_NAME="openSUSE Leap 15.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.3"
BUG_REPORT_URL="https://bugs.opensuse.org/"
HOME_URL="https://www.opensuse.org/"</code></pre>



<h4>4.2 查看升级后已使用的软件库</h4>



<pre class="wp-block-code"><code># zypper ls -d
#  | Alias                     | Name                                                         | Enabled | GPG Check | Refresh | Priority | Type   | URI
---+---------------------------+------------------------------------+---------+-----------+---------+----------+--------+---------------------------------------------------------------------------------------------
1  | repo-non-oss              | Non-OSS Repository                                           | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.3/repo/non-oss/
2  | repo-oss                  | Main Repository                                              | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.3/repo/oss/
3 | repo-update                | Main Update Repository                                       | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/oss/
4 | repo-update-non-oss        | Update Repository (Non-Oss)                                  | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/non-oss/
4  | repo-backports-update     | Update repository of openSUSE Backports                      | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/backports/
5  | repo-sle-update           | Update repository with updates from SUSE Linux Enterprise 15 | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/sle/</code></pre>



<p>（注意：升级到 openSUSE Leap 15.3 系统后，自动新增加了 repo-backports-update 软件库和 repo-sle-update 软件库）</p>
]]></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>[内容] Linux 常见存储和存储类型介绍</title>
		<link>https://eternalcenter-2021-12.github.io/introduction-to-linux-common-storage-and-storage-types/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 19 Aug 2021 12:31:20 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Iscsi]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[Samba]]></category>
		<category><![CDATA[Services (服务)]]></category>
		<category><![CDATA[Storage Services (存储服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></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=17522</guid>

					<description><![CDATA[内容一：常见的存储 1. DAS（直连存储），就是接在主板上的硬盘2. NAS（网络附加存储），例如：NFS、Samba、FTP、HTTP，优点是管理简单，缺点是单点故障3. SAN（网络块存储），例如：Iscsi4. 分布时云存储，例如：Ceph、Swift 内容二：常见的存储类型 1. Block-based access（基于块存储的访问），对应的是块存储（block），例如：直接接在主板上的硬盘、Iscsi、Ceph2. File-based access（基于文件系统的访问），对应的是文件系统存储（filesystem），例如：NFS、Samba、FTP、HTTP、Ceph3. Object-based access（基于对象的访问），对应的是对象存储（object），例如：Ceph]]></description>
										<content:encoded><![CDATA[
<h4>内容一：常见的存储</h4>



<p>1. DAS（直连存储），就是接在主板上的硬盘<br>2. NAS（网络附加存储），例如：NFS、Samba、FTP、HTTP，优点是管理简单，缺点是单点故障<br>3. SAN（网络块存储），例如：Iscsi<br>4. 分布时云存储，例如：Ceph、Swift</p>



<h4>内容二：常见的存储类型</h4>



<p>1. Block-based access（基于块存储的访问），对应的是块存储（block），例如：直接接在主板上的硬盘、Iscsi、Ceph<br>2. File-based access（基于文件系统的访问），对应的是文件系统存储（filesystem），例如：NFS、Samba、FTP、HTTP、Ceph<br>3. Object-based access（基于对象的访问），对应的是对象存储（object），例如：Ceph</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 格式化特点</title>
		<link>https://eternalcenter-2021-12.github.io/linux-formatting-features/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 19 Aug 2021 12:02:18 +0000</pubDate>
				<category><![CDATA[Ceph]]></category>
		<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Clusters (集群)]]></category>
		<category><![CDATA[Distributed Cloud Storages (分布式云存储)]]></category>
		<category><![CDATA[Load Balancing and High Availability Clusters (负载均衡加高可用集群)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></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=17520</guid>

					<description><![CDATA[内容一：格式化后会产生的分区 格式化会格式出 inode 区和 block 区 内容二：inode 区和 block 区的作用 inode 区默认一格大小是 512 个字节，存储哪一份数据存在了哪些 block 里以及数据的所属者、权限创建时间等 metadata 元数据block 区默认一格大小是 4k，只存储数据本身 内容三：Linux 文件格式的特点 ext3 和 ext4 的 inode 区每一格较小，而 xfs 的 inode 区每一格更大，可以存储更多种类，例如快照等 metadata 元数据]]></description>
										<content:encoded><![CDATA[
<h4>内容一：格式化后会产生的分区</h4>



<p>格式化会格式出 inode 区和 block 区</p>



<h4>内容二：inode 区和 block 区的作用</h4>



<p>inode 区默认一格大小是 512 个字节，存储哪一份数据存在了哪些 block 里以及数据的所属者、权限创建时间等 metadata 元数据<br>block 区默认一格大小是 4k，只存储数据本身</p>



<h4>内容三：Linux 文件格式的特点</h4>



<p>ext3 和 ext4 的 inode 区每一格较小，而 xfs 的 inode 区每一格更大，可以存储更多种类，例如快照等 metadata 元数据</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] pip 工具的安装 （MacBook Air 版）</title>
		<link>https://eternalcenter-2021-12.github.io/macbook-air-pip/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 24 May 2021 06:17:53 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Django Foundation (基础)]]></category>
		<category><![CDATA[Django Model Layer (模型层)]]></category>
		<category><![CDATA[Django Template Layer (模版层)]]></category>
		<category><![CDATA[Django View Layer (视图层)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Python Basic (基础)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer (系统电脑)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=14337</guid>

					<description><![CDATA[内容目录： 内容一：安装 pip21.1 下载 pip21.2 安装 pip21.3 删除 pip21.4 查看安装的 pip21.4.1 查看在 python 里有没有 pip 安装包1.4.2 查看有没有 pip2 命令1.4.3 升级 pip2 内容二：安装 pip32.1 准备安装 pip3 所需的环境2.1.1 安装 python32.1.1.1 输入 python3 命令2.1.1.2 在弹出的对话框里安装 python32.1.2 安装 xcode2.1.2.1 输入 xcode-select &#8211;install 命令2.1.2.2 在弹出的对话框里安装 xcode2.2 安装 pip32.2.1 下载 pip32.2.2 安装 pip32.2.3 删除 pip32.2.4 查看安装的 pip32.2.4.1 查看在 python 里有没有 pip &#8230; <p class="link-more"><a href="https://eternalcenter-2021-12.github.io/macbook-air-pip/" class="more-link">Continue reading<span class="screen-reader-text"> "[内容] pip 工具的安装 （MacBook Air 版）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2>内容目录：</h2>



<h4>内容一：安装 pip2<br>1.1 下载 pip2<br>1.2 安装 pip2<br>1.3 删除 pip2<br>1.4 查看安装的 pip2<br>1.4.1 查看在 python 里有没有 pip 安装包<br>1.4.2 查看有没有 pip2 命令<br>1.4.3 升级 pip2</h4>



<h4>内容二：安装 pip3<br>2.1 准备安装 pip3 所需的环境<br>2.1.1 安装 python3<br>2.1.1.1 输入 python3 命令<br>2.1.1.2 在弹出的对话框里安装 python3<br>2.1.2 安装 xcode<br>2.1.2.1 输入 xcode-select &#8211;install 命令<br>2.1.2.2 在弹出的对话框里安装 xcode<br>2.2 安装 pip3<br>2.2.1 下载 pip3<br>2.2.2 安装 pip3<br>2.2.3 删除 pip3<br>2.2.4 查看安装的 pip3<br>2.2.4.1 查看在 python 里有没有 pip 安装包<br>2.2.4.2 查看有没有 pip3 命令<br>2.2.4.3 升级 pip3</h4>



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



<h4>内容一：安装 pip2<br>1.1 下载 pip2</h4>



<pre class="wp-block-code"><code>$ curl 'https://bootstrap.pypa.io/pip/2.7/get-pip.py' &gt; get-pip.py
</code></pre>



<h4>1.2 安装 pip2</h4>



<pre class="wp-block-code"><code>$ sudo python get-pip.py</code></pre>



<h4>1.3 删除 pip2</h4>



<pre class="wp-block-code"><code>$ rm get-pip.py
</code></pre>



<h4>1.4 查看安装的 pip2<br>1.4.1 查看在 python 里有没有 pip 安装包</h4>



<pre class="wp-block-code"><code>$ ls /Library/Python/2.7/site-packages/</code></pre>



<p>（补充：这里以 Python 版本是 2.7 为例）</p>



<h4>1.4.2 查看有没有 pip2 命令</h4>



<pre class="wp-block-code"><code>$ which pip2</code></pre>



<h4>1.4.3 升级 pip2</h4>



<pre class="wp-block-code"><code>$ sudo pip2 install --upgrade pip</code></pre>



<h4>内容二：安装 pip3<br>2.1 准备安装 pip3 所需的环境<br>2.1.1 安装 python3<br>2.1.1.1 输入 python3 命令</h4>



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



<h4>2.1.1.2 在弹出的对话框里安装 python3</h4>



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



<h4>2.1.2 安装 xcode<br>2.1.2.1 输入 xcode-select &#8211;install 命令</h4>



<pre class="wp-block-code"><code>$ xcode-select --install</code></pre>



<h4>2.1.2.2 在弹出的对话框里安装 xcode</h4>



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



<h4>2.2 安装 pip3<br>2.2.1 下载 pip3</h4>



<pre class="wp-block-code"><code>$ curl 'https://bootstrap.pypa.io/pip/get-pip.py' &gt; get-pip.py</code></pre>



<h4>2.2.2 安装 pip3</h4>



<pre class="wp-block-code"><code>$ sudo python get-pip.py</code></pre>



<h4>2.2.3 删除 pip3</h4>



<pre class="wp-block-code"><code>$ rm get-pip.py</code></pre>



<h4>2.2.4 查看安装的 pip3<br>2.2.4.1 查看在 python 里有没有 pip 安装包</h4>



<pre class="wp-block-code"><code>$ ls /Library/Python/3.8/site-packages/</code></pre>



<p>（补充：这里以 Python 版本是 3.8 为例）</p>



<h4>2.2.4.2 查看有没有 pip3 命令</h4>



<pre class="wp-block-code"><code>$ which pip3</code></pre>



<h4>2.2.4.3 升级 pip3</h4>



<pre class="wp-block-code"><code>$ sudo pip3 install --upgrade pip</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 官方软件库链接列表 （CentOS 版）</title>
		<link>https://eternalcenter-2021-12.github.io/official-repo-list-centos/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 27 Apr 2021 08:03:20 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Software (系统软件)]]></category>
		<category><![CDATA[System Upgradation (系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=14151</guid>

					<description><![CDATA[内容一：CentOS 7 基础库列表1.1 CentOS 7 基础库官方链接列表1.1.1 CentOS-7 &#8211; Base http://mirror.centos.org/centos/7/os/x86_64/ 1.1.2 CentOS-7 &#8211; Updates http://mirror.centos.org/centos/7/updates/x86_64/ 1.1.3 CentOS-7 &#8211; Extras http://mirror.centos.org/centos/7/extras/x86_64/ 1.1.4 CentOS-7 &#8211; Plus http://mirror.centos.org/centos/7/centosplus/x86_64/ 1.2 CentOS 7 基础库官方推荐列表1.2.1 CentOS-7 &#8211; Base http://mirrorlist.centos.org/?release=7&#038;arch=x86_64&#038;repo=os&#038;infra=$infra 1.2.2 CentOS-7 &#8211; Updates http://mirrorlist.centos.org/?release=7&#038;arch=x86_64&#038;repo=updates&#038;infra=$infra 1.2.3 CentOS-7 &#8211; Extras http://mirrorlist.centos.org/?release=7&#038;arch=x86_64&#038;repo=extras&#038;infra=$infra 1.2.4 CentOS-7 &#8211; Plus http://mirrorlist.centos.org/?release=7&#038;arch=x86_64&#038;repo=centosplus&#038;infra=$infra 内容二：CentOS 8 基础库列表2.1 CentOS 8 基础库官方链接列表2.1.1 CentOS &#8230; <p class="link-more"><a href="https://eternalcenter-2021-12.github.io/official-repo-list-centos/" class="more-link">Continue reading<span class="screen-reader-text"> "[内容] Linux 官方软件库链接列表 （CentOS 版）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h4>内容一：CentOS 7 基础库列表<br>1.1 CentOS 7 基础库官方链接列表<br>1.1.1 CentOS-7 &#8211; Base</h4>



<p>http://mirror.centos.org/centos/7/os/x86_64/</p>



<h4>1.1.2 CentOS-7 &#8211; Updates</h4>



<p>http://mirror.centos.org/centos/7/updates/x86_64/</p>



<h4>1.1.3 CentOS-7 &#8211; Extras</h4>



<p>http://mirror.centos.org/centos/7/extras/x86_64/</p>



<h4>1.1.4 CentOS-7 &#8211; Plus</h4>



<p>http://mirror.centos.org/centos/7/centosplus/x86_64/</p>



<h4>1.2 CentOS 7 基础库官方推荐列表<br>1.2.1 CentOS-7 &#8211; Base</h4>



<p>http://mirrorlist.centos.org/?release=7&#038;arch=x86_64&#038;repo=os&#038;infra=$infra</p>



<h4>1.2.2 CentOS-7 &#8211; Updates</h4>



<p>http://mirrorlist.centos.org/?release=7&#038;arch=x86_64&#038;repo=updates&#038;infra=$infra</p>



<h4>1.2.3 CentOS-7 &#8211; Extras</h4>



<p>http://mirrorlist.centos.org/?release=7&#038;arch=x86_64&#038;repo=extras&#038;infra=$infra</p>



<h4>1.2.4 CentOS-7 &#8211; Plus</h4>



<p>http://mirrorlist.centos.org/?release=7&#038;arch=x86_64&#038;repo=centosplus&#038;infra=$infra</p>



<h4>内容二：CentOS 8 基础库列表<br>2.1 CentOS 8 基础库官方链接列表<br>2.1.1 CentOS Linux 8 &#8211; BaseOS</h4>



<p>http://mirror.centos.org/centos/8/BaseOS/x86_64/os/</p>



<h4>2.1.2 CentOS-8 &#8211; Updates</h4>



<p>http://mirror.centos.org/centos/8/AppStream/x86_64/os/</p>



<h4>2.2 CentOS 8 基础库官方推荐列表<br>2.2.1 CentOS Linux 8 &#8211; BaseOS</h4>



<p>http://mirrorlist.centos.org/?release=8&#038;arch=x86_64&#038;repo=BaseOS&#038;infra=$infra</p>



<h4>2.2.2 CentOS Linux 8 &#8211; AppStream</h4>



<p>http://mirrorlist.centos.org/?release=8&#038;arch=x86_64&#038;repo=AppStream&#038;infra=$infra</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 内存机制</title>
		<link>https://eternalcenter-2021-12.github.io/memory-mechanism/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 20 Apr 2021 07:37:39 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=14027</guid>

					<description><![CDATA[内容一：Linux 查看内存的命令 内容二：Linux 内存机制 1) total 内存的总大小2) used 正在被使用的内存大小3) free 没有被使用的内存大小4) shared 正在被用于共享的内存大小5) buff/cache 正处于缓存状态的内存大小（当 free 状态的内存不够时，它会自动释放出来）6) available 还可以被应用程序使用的内存大小 （补充：释放处于 shared 状态内存的方法1) # echo 1 > /proc/sys/vm/drop_caches #清除 pagecache2) # echo 2 > /proc/sys/vm/drop_caches #清除 slab3) # echo 3 > /proc/sys/vm/drop_caches #同时清除 pagecache 和 slab）]]></description>
										<content:encoded><![CDATA[
<h4>内容一：Linux 查看内存的命令</h4>



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



<h4>内容二：Linux 内存机制</h4>



<p>1) total 内存的总大小<br>2) used 正在被使用的内存大小<br>3) free 没有被使用的内存大小<br>4) shared 正在被用于共享的内存大小<br>5) buff/cache 正处于缓存状态的内存大小（当 free 状态的内存不够时，它会自动释放出来）<br>6) available 还可以被应用程序使用的内存大小</p>



<p>（<br>补充：释放处于 shared 状态内存的方法<br>1) # echo 1 > /proc/sys/vm/drop_caches #清除 pagecache<br>2) # echo 2 > /proc/sys/vm/drop_caches #清除 slab<br>3) # echo 3 > /proc/sys/vm/drop_caches #同时清除 pagecache 和 slab<br>）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux BIOS 和 EFI 的区分 （系统安装时启动分区种类的查看）</title>
		<link>https://eternalcenter-2021-12.github.io/bios-efi/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 04 Mar 2021 08:46:20 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Installation (系统安装)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></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=13591</guid>

					<description><![CDATA[内容一：判断 Linux 是 BIOS 还是 EFI 的方法 （补充：如果 /sys/firmware/efi 目录存在，则代表系统是 EFI，否则系统是 BIOS） 内容二：判断 Linux 是 BIOS 还是 EFI 的脚本]]></description>
										<content:encoded><![CDATA[
<h4>内容一：判断 Linux 是 BIOS 还是 EFI 的方法</h4>



<pre class="wp-block-code"><code># ls -ld /sys/firmware/efi</code></pre>



<p>（补充：如果 /sys/firmware/efi 目录存在，则代表系统是 EFI，否则系统是 BIOS）</p>



<h4>内容二：判断 Linux 是 BIOS 还是 EFI 的脚本</h4>



<pre class="wp-block-code"><code># &#91; -d /sys/firmware/efi ] &amp;&amp; echo UEFI || echo BIOS</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] KVM 虚拟机模板的创建 （openSUSE Leap 15 版）</title>
		<link>https://eternalcenter-2021-12.github.io/kvm-template-install-opensuse-leap-15/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 06 Feb 2021 14:23:47 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Cloud Computing (云计算)]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Installation (系统安装)]]></category>
		<category><![CDATA[Virtualization (虚拟化)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=13283</guid>

					<description><![CDATA[注意： 在创建 KVM 虚拟机之前要先安装 KVM 并创建 KVM 虚拟网络 软件准备： 在 openSUSE 官网上下载安装系统所需要的镜像： https://software.opensuse.org/distributions/leap 正文： 步骤目录： 步骤一：理解创建 KVM 虚拟机模板的目的 步骤二：为这个虚拟机创建硬盘文件 template_opensuse_leap_15_10g.qcow21.1 创建硬盘文件 template_opensuse_leap_15_10g.qcow21.2 确认硬盘文件 template_opensuse_leap_15_10g.qcow2 已创建 步骤三：使用 KVM 和刚刚创建的硬盘文件新安装一台虚拟机3.1 启动 KVM 的 virt-manager3.2 在 virt-manager 上的左上角点击文件之后 “点击新建虚拟机”3.2.1 选择以本地安装介质的方式安装系统3.2.2 选择安装系统的系统镜像3.2.3 设置内存大小和处理器数量3.2.4 选择用刚刚创建的硬盘文件来安装系统3.2.5 给虚拟机命名为 “template_centos_7_10g” 并选择虚拟网络 “0”3.2.6 开始安装系统3.2.7 进入 “Language, Keyboard and License Agreement” 后选择系统语言，再点击 “Next”3.2.8 当出现 &#8220;Activate &#8230; <p class="link-more"><a href="https://eternalcenter-2021-12.github.io/kvm-template-install-opensuse-leap-15/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] KVM 虚拟机模板的创建 （openSUSE Leap 15 版）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2>注意：</h2>



<p>在创建 KVM 虚拟机之前要先安装 KVM 并创建 KVM 虚拟网络</p>



<div class="wp-block-buttons is-content-justification-center">
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link no-border-radius" href="https://eternalcenter-2021-12.github.io/?p=5476">KVM 的安装</a></div>



<div class="wp-block-button is-style-outline"><a class="wp-block-button__link no-border-radius" href="https://eternalcenter-2021-12.github.io/?p=5389">KVM 虚拟网络的创建</a></div>
</div>



<h2>软件准备：</h2>



<p>在 openSUSE 官网上下载安装系统所需要的镜像：</p>



<p class="has-text-align-center"><a href="https://software.opensuse.org/distributions/leap" target="_blank" rel="noreferrer noopener">https://software.opensuse.org/distributions/leap</a></p>



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



<h2>正文：</h2>



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



<h4>步骤一：理解创建 KVM 虚拟机模板的目的</h4>



<h4>步骤二：为这个虚拟机创建硬盘文件 template_opensuse_leap_15_10g.qcow2<br>1.1 创建硬盘文件 template_opensuse_leap_15_10g.qcow2<br>1.2 确认硬盘文件 template_opensuse_leap_15_10g.qcow2 已创建</h4>



<h4>步骤三：使用 KVM 和刚刚创建的硬盘文件新安装一台虚拟机<br>3.1 启动 KVM 的 virt-manager<br>3.2 在 virt-manager 上的左上角点击文件之后 “点击新建虚拟机”<br>3.2.1 选择以本地安装介质的方式安装系统<br>3.2.2 选择安装系统的系统镜像<br>3.2.3 设置内存大小和处理器数量<br>3.2.4 选择用刚刚创建的硬盘文件来安装系统<br>3.2.5 给虚拟机命名为 “template_centos_7_10g” 并选择虚拟网络 “0”<br>3.2.6 开始安装系统<br>3.2.7 进入 “Language, Keyboard and License Agreement” 后选择系统语言，再点击 “Next”<br>3.2.8 当出现 &#8220;Activate online repositories now?&#8221; 时，点击 “No”<br>3.2.9 进入 “System Role” 后选择 “Server”，再点击 “Next”<br>3.2.10 进入 “Suggested Partitioning” 后点击 “Guided Setup”<br>3.2.11 进入 “Partitioning Scheme” 后点击 “Next”<br>3.2.12 进入 “Filesystem Options” 后 “File System Type“ 选择 “XFS”，再点击 “Next”<br>3.2.13 回到 “Suggested Partitioning” 后点击 “Next”<br>3.2.14 进入 “Clock and Time Zone” 后选择时区，再点击 “Next”<br>3.2.15 进入 “Local User” 后选择 “Skip User Creation” 并点击 “Next”<br>3.2.16 进入 “Authentication for the System Administrator &#8220;root&#8221;” 后给 root 设置密码，再点击 “Next”<br>3.2.17 如果出现 “YaST2 The password is too simple” 则点击 “Yes”<br>3.2.18 进入 “Installation Settings” 后点击 “Next”<br>3.2.19 当出现 “Confirm Installation” 时点击 “Install”<br>3.2.20 当出现 “The system will reboot now…” 时，点击 “Ok”<br>3.2.21 在安装系统的过程中需要注意的内容总结</h4>



<h4>步骤四：进入新创建虚拟机修改配置<br>4.1 添加 Console 配置<br>4.1.1 修改 grub 内核配置文件<br>4.1.2 使修改的 grub 内核配置生效<br>4.2 将系统自动挂载的硬盘从使用 uuid 换成硬件路径<br>4.2.1 查看根分区的 UUID<br>4.2.2 在自动挂载文件里将根分区的 UUID 换成硬件路径<br>4.3 删除不用的软件<br>4.4 进行分区扩展<br>4.4.1 安装分区扩展软件<br>4.4.2 给开机自启配置文件相应的权限<br>4.4.3 设置开机自动扩容根目录<br>4.4.3.1 让 systemctl 管理 /root/growpart.sh 脚本<br>4.4.3.1.1 创建 systemctl 管理 /root/growpart.sh 脚本的配置文件<br>4.4.3.1.2 让 systemctl 管理 /root/growpart.sh 脚本<br>4.4.3.2 设置开机自动扩容根目录<br>4.5 只使用本地软件源（选做）<br>4.5.1 禁用所有软件源（选做）<br>4.5.2 添加本地软件源（选做）<br>4.5.3 添加本地软件源（选做）<br>4.6 修改虚拟机系统的名称<br>4.7 启用 serial 服务实现通过 virsh console 命令控制虚拟机<br>4.8 清除虚拟系统的历史命令<br>4.9 关闭虚拟机</h4>



<h4>步骤五：此时就可以将此虚拟机的硬件文件作为模板进行批量克隆虚拟机了</h4>



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



<h4>步骤一：理解创建 KVM 虚拟机模板的目的</h4>



<p>主要用于批量克隆出新的 KVM 机器，节约创建新虚拟机的时间</p>



<h4>步骤二：为这个虚拟机创建硬盘文件 template_opensuse_leap_15_10g.qcow2<br>1.1 创建硬盘文件 template_opensuse_leap_15_10g.qcow2</h4>



<p>（只在真机上执行以下步骤）</p>



<pre class="wp-block-code"><code># qemu-img create -f qcow2 /var/lib/libvirt/images/template_opensuse_leap_15_10g.qcow2 10G</code></pre>



<h4>1.2 确认硬盘文件 template_opensuse_leap_15_10g.qcow2 已创建</h4>



<p>（只在真机上执行以下步骤）</p>



<pre class="wp-block-code"><code># ls /var/lib/libvirt/images/ | grep template_opensuse_leap_15_10g.qcow2</code></pre>



<h4>步骤三：使用 KVM 和刚刚创建的硬盘文件新安装一台虚拟机<br>3.1 启动 KVM 的 virt-manager</h4>



<p>（只在真机上执行以下步骤）</p>



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



<h4>3.2 在 virt-manager 上的左上角点击文件之后 “点击新建虚拟机”</h4>



<p>（只在真机上执行以下步骤）</p>



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



<h4>3.2.1 选择以本地安装介质的方式安装系统</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="502" height="539" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-1.png" alt="" class="wp-image-19725" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-1.png 502w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-1-279x300.png 279w" sizes="(max-width: 502px) 100vw, 502px" /><figcaption>（图：1）</figcaption></figure></div>



<h4>3.2.2 选择安装系统的系统镜像</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="502" height="539" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-2.png" alt="" class="wp-image-19726" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-2.png 502w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-2-279x300.png 279w" sizes="(max-width: 502px) 100vw, 502px" /><figcaption>（图：2）</figcaption></figure></div>



<h4>3.2.3 设置内存大小和处理器数量</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="502" height="539" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-3.png" alt="" class="wp-image-19727" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-3.png 502w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-3-279x300.png 279w" sizes="(max-width: 502px) 100vw, 502px" /><figcaption>（图：3）</figcaption></figure></div>



<h4>3.2.4 选择用刚刚创建的硬盘文件来安装系统</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="502" height="539" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-4.png" alt="" class="wp-image-19728" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-4.png 502w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-4-279x300.png 279w" sizes="(max-width: 502px) 100vw, 502px" /><figcaption>（图：4）</figcaption></figure></div>



<h4>3.2.5 给虚拟机命名为 “template_opensuse_leap_15_10g” 并选择虚拟网络 “0”</h4>



<p>（只在真机上执行以下步骤）</p>



<p>（注意：虚拟网络必须提前创建好）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="502" height="539" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-5.png" alt="" class="wp-image-19729" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-5.png 502w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-5-279x300.png 279w" sizes="(max-width: 502px) 100vw, 502px" /><figcaption>（图：5）</figcaption></figure></div>



<h4>3.2.6 开始安装系统</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="768" height="613" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-6.png" alt="" class="wp-image-19730" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-6.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-6-300x239.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：6）</figcaption></figure></div>



<h4>3.2.7 进入 “Language, Keyboard and License Agreement” 后选择系统语言，再点击 “Next”</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="768" height="466" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-7.png" alt="" class="wp-image-19731" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-7.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-7-300x182.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：7）</figcaption></figure></div>



<h4>3.2.8 当出现 &#8220;Activate online repositories now?&#8221; 时，点击 “No”</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="768" height="466" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-8.png" alt="" class="wp-image-19733" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-8.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-8-300x182.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：8）</figcaption></figure></div>



<h4>3.2.9 进入 “System Role” 后选择 “Server”，再点击 “Next”</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="768" height="466" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-9.png" alt="" class="wp-image-19734" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-9.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-9-300x182.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：9）</figcaption></figure></div>



<h4>3.2.10 进入 “Suggested Partitioning” 后点击 “Guided Setup”</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="768" height="466" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-10.png" alt="" class="wp-image-19735" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-10.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-10-300x182.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：10）</figcaption></figure></div>



<h4>3.2.11 进入 “Partitioning Scheme” 后点击 “Next”</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="768" height="466" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-11.png" alt="" class="wp-image-19736" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-11.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-11-300x182.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：11）</figcaption></figure></div>



<h4>3.2.12 进入 “Filesystem Options” 后 “File System Type“ 选择 “XFS”，再点击 “Next”</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="768" height="466" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-12.png" alt="" class="wp-image-19737" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-12.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-12-300x182.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：12）</figcaption></figure></div>



<h4>3.2.13 回到 “Suggested Partitioning” 后点击 “Next”</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="768" height="466" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-13.png" alt="" class="wp-image-19738" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-13.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-13-300x182.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：13）</figcaption></figure></div>



<h4>3.2.14 进入 “Clock and Time Zone” 后选择时区，再点击 “Next”</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="768" height="266" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-14.png" alt="" class="wp-image-19739" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-14.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-14-300x104.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：14）</figcaption></figure></div>



<h4>3.2.15 进入 “Local User” 后选择 “Skip User Creation” 并点击 “Next”</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="768" height="466" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-15.png" alt="" class="wp-image-19740" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-15.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-15-300x182.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：15）</figcaption></figure></div>



<h4>3.2.16 进入 “Authentication for the System Administrator &#8220;root&#8221;” 后给 root 设置密码，再点击 “Next”</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="768" height="466" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-16.png" alt="" class="wp-image-19741" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-16.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-16-300x182.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：16）</figcaption></figure></div>



<h4>3.2.17 如果出现 “YaST2 The password is too simple” 则点击 “Yes”</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="768" height="466" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-17.png" alt="" class="wp-image-19742" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-17.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-17-300x182.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：17）</figcaption></figure></div>



<h4>3.2.18 进入 “Installation Settings” 后点击 “Next”</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="768" height="466" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-18.png" alt="" class="wp-image-19743" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-18.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-18-300x182.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：18）</figcaption></figure></div>



<h4>3.2.19 当出现 “Confirm Installation” 时点击 “Install”</h4>



<p>（只在真机上执行以下步骤）</p>



<figure class="wp-block-image size-full"><img loading="lazy" width="768" height="466" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-19.png" alt="" class="wp-image-19744" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-19.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-19-300x182.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：19）</figcaption></figure>



<h4>3.2.20 当出现 “The system will reboot now…” 时，点击 “Ok”</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="768" height="466" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-20.png" alt="" class="wp-image-19745" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-20.png 768w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2021/12/KVM-template-openSUSE-15-20-300x182.png 300w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>（图：20）</figcaption></figure></div>



<pre class="wp-block-code"><code>3.2.21 在安装系统的过程中需要注意的内容总结
1) 一定要使用刚刚创建的 template_opensuse_leap_15_10g.qcow2 作为安装虚拟机的硬件文件
2) 虚拟机网络 “0” 要提前创建好
3) 只分一个分区，只设置一个挂载点挂载到根，使用标准硬盘，硬盘格式是 XFS
4) 选择最小化安装系统</code></pre>



<pre class="wp-block-code"><code>步骤四：进入新创建虚拟机修改配置
（只在虚拟机上执行以下步骤）
4.1 添加 Console 配置
4.1.1 修改 grub 内核配置文件
# vi /etc/default/grub
将全部内容修改如下：
# If you change this file, run 'grub2-mkconfig -o /boot/grub2/grub.cfg' afterwards to update
# /boot/grub2/grub.cfg.

# Uncomment to set your own custom distributor. If you leave it unset or empty, the default
# policy is to determine the value from /etc/os-release
GRUB_DISTRIBUTOR=
GRUB_DEFAULT=saved
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=8
GRUB_CMDLINE_LINUX_DEFAULT="splash=silent mitigations=auto quiet"
GRUB_SERIAL_COMMAND="serial --unit=1 --speed=115200"
GRUB_CMDLINE_LINUX="biosdevname=0 net.ifnames=0 console=tty0 console=ttyS0,115200n8"
GRUB_DISABLE_LINUX_UUID="true"
GRUB_ENABLE_LINUX_LABEL="true"
GRUB_DISABLE_RECOVERY="true"

# Uncomment to automatically save last booted menu entry in GRUB2 environment

# variable `saved_entry'
# GRUB_SAVEDEFAULT="true"
#Uncomment to enable BadRAM filtering, modify to suit your needs

# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
# GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
#Uncomment to disable graphical terminal (grub-pc only)

GRUB_TERMINAL="gfxterm"
# The resolution used on graphical terminal
#note that you can use only modes which your graphic card supports via VBE

# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE="auto"
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
# GRUB_DISABLE_LINUX_UUID=true
#Uncomment to disable generation of recovery mode menu entries

# GRUB_DISABLE_RECOVERY="true"
#Uncomment to get a beep at grub start

# GRUB_INIT_TUNE="480 440 1"
GRUB_BACKGROUND=
GRUB_THEME=/boot/grub2/themes/openSUSE/theme.txt
SUSE_BTRFS_SNAPSHOT_BOOTING="true"
GRUB_DISABLE_OS_PROBER="false"
GRUB_ENABLE_CRYPTODISK="n"
GRUB_CMDLINE_XEN_DEFAULT="vga=gfx-1024x768x16"

4.1.2 使修改的 grub 内核配置生效
# grub2-mkconfig -o grub

4.2 将系统自动挂载的硬盘从使用 uuid 换成硬件路径
4.2.1 查看根分区的 UUID
# blkid
/dev/vda1: UUID="53ee2f87-89b8-4cd7-a4dc-0957d28f4831" TYPE="xfs" PARTUUID="3d8377ef-01"

（补充：这里的 UUID 是： 53ee2f87-89b8-4cd7-a4dc-0957d28f4831）

4.2.2 在自动挂载文件里将根分区的 UUID 换成硬件路径
# vi /etc/fstab
将以下内容：
......
UUID=53ee2f87-89b8-4cd7-a4dc-0957d28f4831 /                   xfs     defaults        0 0

（补充：这里的 UUID 是： 53ee2f87-89b8-4cd7-a4dc-0957d28f4831）

修改为：
/dev/vda1 /                   xfs     defaults        0 0

4.3 删除不用的软件
# zypper -n rm firewalld-*

4.4 进行分区扩展
4.4.1 安装分区扩展软件
# zypper -n in growpart

4.4.2 给开机自启配置文件相应的权限
# chmod 755 /root/growpart.sh

4.4.3 设置开机自动扩容根目录
4.4.3.1 让 systemctl 管理 /root/growpart.sh 脚本
4.4.3.1.1 创建 systemctl 管理 /root/growpart.sh 脚本的配置文件
# vim /etc/systemd/system/growpart.service
创建以下内容：
&#91;Unit]
Description=growpart
After=default.target

&#91;Service]
Type=oneshot
ExecStart=/root/growpart.sh

&#91;Install]
WantedBy=default.target

4.4.3.1.2 让 systemctl 管理 /root/growpart.sh 脚本
# systemctl daemon-reload

4.4.3.2 设置开机自动扩容根目录
# systemctl enable --now growpart.service

4.5 只使用本地软件源（选做）
4.5.1 禁用所有软件源（选做）
# zypper mr -da

4.5.2 添加本地软件源（选做）
# zypper ar -fcg http://10.0.0.254/openSUSE-Leap-15/ lan

(注意： http://10.0.0.254/openSUSE-Leap-15/ 需要根据真实环境的情况进行更改)

4.5.3 添加本地软件源（选做）
# zypper ref

4.6 修改虚拟机系统的名称
# hostnamectl set-hostname template_opensuse_leap_15_10g

4.7 启用 serial 服务实现通过 virsh console 命令控制虚拟机
# systemctl start serial-getty@ttyS0
# systemctl enable serial-getty@ttyS0

4.8 清除虚拟系统的历史命令
# history -c

4.9 关闭虚拟机
# poweroff

步骤五：此时就可以将此虚拟机的硬件文件作为模板进行批量克隆虚拟机了
（只在真机上执行以下步骤）</code></pre>



<h4>3.2.21 在安装系统的过程中需要注意的内容总结</h4>



<p>（只在真机上执行以下步骤）</p>



<p>1)  一定要使用刚刚创建的 template_opensuse_leap_15_10g.qcow2 作为安装虚拟机的硬件文件<br>2)  虚拟机网络 “0” 要提前创建好<br>3)  只分一个分区，只设置一个挂载点挂载到根，使用标准硬盘，硬盘格式是 XFS<br>4)  选择最小化安装系统</p>



<h4>步骤四：进入新创建虚拟机修改配置<br>4.1 添加 Console 配置<br>4.1.1 修改 grub 内核配置文件</h4>



<p>（只在虚拟机上执行以下步骤）</p>



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



<p>将全部内容修改如下：</p>



<pre class="wp-block-code"><code># If you change this file, run 'grub2-mkconfig -o /boot/grub2/grub.cfg' afterwards to update
# /boot/grub2/grub.cfg.

# Uncomment to set your own custom distributor. If you leave it unset or empty, the default
# policy is to determine the value from /etc/os-release
GRUB_DISTRIBUTOR=
GRUB_DEFAULT=saved
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=8
GRUB_CMDLINE_LINUX_DEFAULT="splash=silent mitigations=auto quiet"
GRUB_SERIAL_COMMAND="serial --unit=1 --speed=115200"
GRUB_CMDLINE_LINUX="biosdevname=0 net.ifnames=0 console=tty0 console=ttyS0,115200n8"
GRUB_DISABLE_LINUX_UUID="true"
GRUB_ENABLE_LINUX_LABEL="true"
GRUB_DISABLE_RECOVERY="true"

# Uncomment to automatically save last booted menu entry in GRUB2 environment

# variable `saved_entry'
# GRUB_SAVEDEFAULT="true"
#Uncomment to enable BadRAM filtering, modify to suit your needs

# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
# GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
#Uncomment to disable graphical terminal (grub-pc only)

GRUB_TERMINAL="gfxterm"
# The resolution used on graphical terminal
#note that you can use only modes which your graphic card supports via VBE

# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE="auto"
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
# GRUB_DISABLE_LINUX_UUID=true
#Uncomment to disable generation of recovery mode menu entries

# GRUB_DISABLE_RECOVERY="true"
#Uncomment to get a beep at grub start

# GRUB_INIT_TUNE="480 440 1"
GRUB_BACKGROUND=
GRUB_THEME=/boot/grub2/themes/openSUSE/theme.txt
SUSE_BTRFS_SNAPSHOT_BOOTING="true"
GRUB_DISABLE_OS_PROBER="false"
GRUB_ENABLE_CRYPTODISK="n"
GRUB_CMDLINE_XEN_DEFAULT="vga=gfx-1024x768x16"</code></pre>



<h4>4.1.2 使修改的 grub 内核配置生效</h4>



<p>（只在虚拟机上执行以下步骤）</p>



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



<h4>4.2 将系统自动挂载的硬盘从使用 uuid 换成硬件路径<br>4.2.1 查看根分区的 UUID</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># blkid
/dev/vda1: UUID="53ee2f87-89b8-4cd7-a4dc-0957d28f4831" TYPE="xfs" PARTUUID="3d8377ef-01"</code></pre>



<p>（补充：这里的 UUID 是： 53ee2f87-89b8-4cd7-a4dc-0957d28f4831）</p>



<h4>4.2.2 在自动挂载文件里将根分区的 UUID 换成硬件路径</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># vi /etc/fstab</code></pre>



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



<pre class="wp-block-code"><code>......
UUID=53ee2f87-89b8-4cd7-a4dc-0957d28f4831 /                   xfs     defaults        0 0</code></pre>



<p>（补充：这里的 UUID 是： 53ee2f87-89b8-4cd7-a4dc-0957d28f4831）</p>



<p>修改为：</p>



<pre class="wp-block-code"><code>......
/dev/vda1 /                   xfs     defaults        0 0</code></pre>



<h4>4.3 删除不用的软件</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># zypper -n rm firewalld-*</code></pre>



<h4>4.4 进行分区扩展<br>4.4.1 安装分区扩展软件</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># zypper -n in growpart</code></pre>



<h4>4.4.2 给开机自启配置文件相应的权限</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># chmod 755 /root/growpart.sh</code></pre>



<h4>4.4.3 设置开机自动扩容根目录<br>4.4.3.1 让 systemctl 管理 /root/growpart.sh 脚本<br>4.4.3.1.1 创建 systemctl 管理 /root/growpart.sh 脚本的配置文件</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># vim /etc/systemd/system/growpart.service</code></pre>



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



<pre class="wp-block-code"><code>&#91;Unit]
Description=growpart
After=default.target

&#91;Service]
Type=oneshot
ExecStart=/root/growpart.sh

&#91;Install]
WantedBy=default.target</code></pre>



<h4>4.4.3.1.2 让 systemctl 管理 /root/growpart.sh 脚本</h4>



<p>（只在虚拟机上执行以下步骤）</p>



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



<h4>4.4.3.2 设置开机自动扩容根目录</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># systemctl enable --now growpart.service</code></pre>



<h4>4.5 只使用本地软件源（选做）<br>4.5.1 禁用所有软件源（选做）</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># zypper mr -da</code></pre>



<h4>4.5.2 添加本地软件源（选做）</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># zypper ar -fcg http://10.0.0.254/openSUSE-Leap-15/ lan</code></pre>



<p>(注意： http://10.0.0.254/openSUSE-Leap-15/ 需要根据真实环境的情况进行更改)</p>



<h4>4.5.3 添加本地软件源（选做）</h4>



<p>（只在虚拟机上执行以下步骤）</p>



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



<h4>4.6 修改虚拟机系统的名称</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># hostnamectl set-hostname template_opensuse_leap_15_10g</code></pre>



<h4>4.7 启用 serial 服务实现通过 virsh console 命令控制虚拟机</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># systemctl start serial-getty@ttyS0
# systemctl enable serial-getty@ttyS0</code></pre>



<h4>4.8 清除虚拟系统的历史命令</h4>



<p>（只在虚拟机上执行以下步骤）</p>



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



<h4>4.9 关闭虚拟机</h4>



<p>（只在虚拟机上执行以下步骤）</p>



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



<h4>步骤五：此时就可以将此虚拟机的硬件文件作为模板进行批量克隆虚拟机了</h4>



<p>（只在真机上执行以下步骤）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 批量设置官方软件源 （openSUSE  Leap 15.2 版）</title>
		<link>https://eternalcenter-2021-12.github.io/shell-opensuse-official-repo/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 06 Feb 2021 06:21:52 +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 Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Software (系统软件)]]></category>
		<category><![CDATA[System Upgradation (系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=13277</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：批量设置官方软件源（openSUSE 版）作用：批量设置官方软件源（openSUSE 版） 使用方法：1. 服务器清单 $add_repo_servers_list.txt 每一个服务器名占用一行，并和此脚本放在同一目录下2. 在此脚本的分割线内写入相应的内容3. 给此脚本添加执行权限4. 执行此脚本 脚本分割线里的变量：add_repo_servers_list.txt #指定存放要设置官方软件源的文件 注意：1. 此脚本执行前必须要先保证执行此脚本的用户能无密码 ssh 远程这些远程服务器2. 服务器的系统需要是 openSUSE 15.2 版本3. 服务器系统要配置好可用的软件源（最好是软件数量最多的官方版本）4. 这些远程服务器要能够连接外网 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：批量设置官方软件源（openSUSE 版）<br>作用：批量设置官方软件源（openSUSE 版）</p>



<p>使用方法：<br>1. 服务器清单 $add_repo_servers_list.txt 每一个服务器名占用一行，并和此脚本放在同一目录下<br>2. 在此脚本的分割线内写入相应的内容<br>3. 给此脚本添加执行权限<br>4. 执行此脚本</p>



<p>脚本分割线里的变量：<br>add_repo_servers_list.txt #指定存放要设置官方软件源的文件</p>



<p>注意：<br>1. 此脚本执行前必须要先保证执行此脚本的用户能无密码 ssh 远程这些远程服务器<br>2. 服务器的系统需要是 openSUSE 15.2 版本<br>3. 服务器系统要配置好可用的软件源（最好是软件数量最多的官方版本）<br>4. 这些远程服务器要能够连接外网</p>



<h2>脚本：</h2>



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

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

add_repo_servers_list.txt

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

cat add_repo_servers_list.txt
read -p "will add opensuse_leap_15.2 repo please input y " a
echo $a

if &#91; "$a" != "y" ];then
        echo "you don't agree so exit now"
        exit
fi

for i in `awk '{print $1}' add_repo_servers_list.txt`
do
        ssh $i '
        sudo -u root su - root -c "zypper mr -da"
        sudo -u root su - root -c "zypper ar -fcg http://download.opensuse.org/distribution/leap/15.2/repo/oss/ OpenSUSE_Leap_152_x64_update-oss"
        sudo -u root su - root -c "zypper ar -fcg http://download.opensuse.org/distribution/leap/15.2/repo/non-oss/ OpenSUSE_Leap_152_x64_update-non-oss"
        sudo -u root su - root -c "zypper ar -fcg http://download.opensuse.org/update/leap/15.2/oss/ OpenSUSE_Leap_152_x64_oss"
        sudo -u root su - root -c "zypper ar -fcg http://download.opensuse.org/update/leap/15.2/non-oss/ OpenSUSE_Leap_152_x64_non-oss"
        sudo -u root su - root -c "zypper ref"
done</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] openSUSE 软件库的使用 （通过本地镜像实现）</title>
		<link>https://eternalcenter-2021-12.github.io/zypper-local/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 04 Feb 2021 06:08:43 +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 Software (系统软件)]]></category>
		<category><![CDATA[System Upgradation (系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=13269</guid>

					<description><![CDATA[步骤一：挂载本地镜像 （补充：这里以挂载 /dev/sr1 到 /mnt 目录为例） 步骤二：添加本地镜里的软件源 （补充：这里以将 file:///mnt/Module-Basesystem 添加到软件源并命名为 local 为例）]]></description>
										<content:encoded><![CDATA[
<h4>步骤一：挂载本地镜像</h4>



<pre class="wp-block-code"><code># mount /dev/sr1 /mnt</code></pre>



<p>（补充：这里以挂载 /dev/sr1 到 /mnt 目录为例）</p>



<h4>步骤二：添加本地镜里的软件源</h4>



<pre class="wp-block-code"><code># zypper ar file:///mnt/Module-Basesystem local</code></pre>



<p>（补充：这里以将 file:///mnt/Module-Basesystem 添加到软件源并命名为 local 为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 ipmitool （管理服务器硬件）（转载）</title>
		<link>https://eternalcenter-2021-12.github.io/ipmitool/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 23 Oct 2020 14:12:26 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=11597</guid>

					<description><![CDATA[注明：所有转载内容皆直接从被转载文章网页的标题和内容的文本中复制而来]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code>ipmitool安装，常用指令

IPMI: Intelligent Platform Management Interface
1.下载地址：

https:&#47;&#47;sourceforge.net/projects/ipmitool/
2.安装步骤

a. tar -xvf ipmitool-1.8.18.tar.bz2
b. cd ipmitool-1.8.18
c. ./configure
d. make
e.make install
f.
modprobe ipmi_si
modprobe ipmi_devintf
modprobe ipmi_msghandler
安装成功（实测Centos7.4）
3.常用指令

    远程电源控制类 远程电源控制类
    Ipmitool -I lanplus –H 10.32.228.111 –U username –P Passwordchassis power off
    Ipmitool -I lanplus –H 10.32.228.111 –U username –P Passwordchassis power on
    Ipmitool -I lanplus –H 10.32.228.111 –U username –P Passwordchassis power reset
    Ipmitool -I lanplus –H 10.32.228.111 –U username –P Passwordchassis power cycle
    (注意power cycle 和power reset的区别在于前者从掉电到上电有１秒钟的间隔，而后者是很快上电)
    读取系统状态类
    Ipmitool sensor list 　显示系统所有传感器列表
    Ipmitool fru list　　　显示系统所有现场可替代器件的列表
    Ipmitool sdr list　　　显示系统所有SDRRepository设备列表　
    Ipmitool pef list 　　显示系统平台时间过滤的列表
    3 系统日志类
    Ipmitool sel elist　　　显示所有系统事件日志
    Ipmitool sel clear　　　删除所有系统时间日志
    Ipmitool sel delete ID 删除第ID条SEL
    Ipmitool sel time get 　显示当前BMC的时间
    Ipmitool sel time set XXX 设置当前BMC的时间
    启动设置类
    Ipmitool chassis bootdev bios 重启后停在BIOS 菜单
    Ipmitool chassis bootdev pxe　重启后从PXE启动
    系统相关的命令
    Ipmitool mc info 显示BMC版本信息
    Ipmitool bmc reset cold BMC 热启动
    Ipmitool bmc reset warmBMC冷启动
    网络接口相关命令
    Ipmitool lan print 1 显示channel1的网络配置信息
    Ipmitool lan set 1ipaddr 10.32.2.2 设置channel1的IP地址
    Ipmitool lan set 1 netmask 255.255.0.0 设置channel1的netmask
    Ipmitool lan set 4 defgw ipaddr255.255.0.254 设置channel4的网关
    Ipmitool lan set 2 defgw macaddr 　设置channel2的网关mac address
    Ipmitool lan set 2 ipsrc dhcp 设置channel2的ip 源在DHCP
    Ipmitool lan set 3 ipsrc static 设置channel2的ip是静态获得的
    通道相关命令
    Ipmitool channel info　显示系统默认channel
    Ipmitool channel authcap channel-number privilege 　修改通道的优先级别
    Ipmitool channel getaccess channel-number user-id　读取用户在通道上的权限
    Ipmitool channel setacccess channel-number user-id callin=on ipmi=on link=onprivilege=5 // 设置用户在通道上的权限
    看门狗相关命令
    Ipmitool mc watchdog get　读取当前看门狗的设置
    Ipmitool watchdog off 　　关掉看门狗
    Ipmitool watchdog reset 　　在最近设置的计数器的基础上重启看门狗
    用户管理相关命令
    Ipmitool user list chan-id 显示某通道上的所有用户
    Ipmitool set password &#91;] 修改某用户的密码
    Ipmitool disable 　　禁止掉某用户
    ipmitool enable 　　使能某用户
    ipmitool priv &#91;]　修改某用户在某通道上的权限
    ipmitool test &lt;16|20>&#91;&lt;password]>　测试用户
————————————————
版权声明：本文为CSDN博主「Rudy,Zhao」的原创文章，遵循CC 4.0 BY-SA版权协议，转载请附上原文出处链接及本声明。
原文链接：https://blog.csdn.net/weixin_40343504/article/details/82664389</code></pre>



<p>注明：所有转载内容皆直接从被转载文章网页的标题和内容的文本中复制而来</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="1013" height="191" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2020/10/版权申明证明-ipmitool-.png" alt="" class="wp-image-11600" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2020/10/版权申明证明-ipmitool-.png 1013w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2020/10/版权申明证明-ipmitool--300x57.png 300w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2020/10/版权申明证明-ipmitool--768x145.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>CC 4.0 BY-SA 版权协议网址：https://creativecommons.org/licenses/by-sa/4.0/deed.z</figcaption></figure></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] 远程虚拟化平台的搭建</title>
		<link>https://eternalcenter-2021-12.github.io/remote-virtual-platform/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 26 Sep 2020 10:10:37 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Cloud Computing (云计算)]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[Other Services (其他服务)]]></category>
		<category><![CDATA[Services (服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer (系统电脑)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[Virtualization (虚拟化)]]></category>
		<category><![CDATA[VNC]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=10587</guid>

					<description><![CDATA[步骤目录： 步骤一：规划拓扑1.1 电脑列表1.2 服务器列表简介 步骤二：给电脑安装 CentOS 8.2 系统 步骤三：安装图形系统桌面 步骤四：安装中文输入法4.1 安装中文库4.2 确认中文库已经安装4.3 安装中文输入法 步骤五：创建用户5.1 创建用户5.2 给用户设置密码 步骤六：增加 CentOS 8.2 系统的稳定性6.1 延长看门狗喂狗间隔以减少系统被软锁出现 softlockup 的几率6.1.1 临时延长看门狗喂狗间隔的时间6.1.2 永久延长看门狗喂狗间隔的时间6.1.2.1 添加延长看门狗喂狗间隔的设置6.1.2.2 让添加延长看门狗喂狗间隔的设置生效6.1.3 让 softlockup 触发后直接宕机6.2 禁止图形系统桌面的 DNS 和路由以避免系统崩溃6.2.1 添加禁止图形系统桌面的 DNS 和路由的设置6.2.2 让禁止图形系统桌面的 DNS 和路由的设置生效6.3 禁止图形系统界面自动黑屏或自动挂起6.4 让 SSH 联接永久不超时6.4.1 让 SSH 服务端的连接不超时6.4.2 让用户登陆永不超时6.4.2.1 在系统文件里添加让用户登陆永不超时的设置6.4.2.2 让用户登陆永不超时的设置立刻生效6.5 删除不需要的软件包以避免 CPU 占用过高而崩溃（选做） 步骤七：搭建虚拟化平台 步骤八：实现文件共享8.1 安装 &#8230; <p class="link-more"><a href="https://eternalcenter-2021-12.github.io/remote-virtual-platform/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] 远程虚拟化平台的搭建"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2>步骤目录：</h2>



<h4>步骤一：规划拓扑<br>1.1 电脑列表<br>1.2 服务器列表简介</h4>



<h4>步骤二：给电脑安装 CentOS 8.2 系统</h4>



<h4>步骤三：安装图形系统桌面</h4>



<h4>步骤四：安装中文输入法<br>4.1 安装中文库<br>4.2 确认中文库已经安装<br>4.3 安装中文输入法</h4>



<h4>步骤五：创建用户<br>5.1 创建用户<br>5.2 给用户设置密码</h4>



<h4>步骤六：增加 CentOS 8.2 系统的稳定性<br>6.1 延长看门狗喂狗间隔以减少系统被软锁出现 softlockup 的几率<br>6.1.1 临时延长看门狗喂狗间隔的时间<br>6.1.2 永久延长看门狗喂狗间隔的时间<br>6.1.2.1 添加延长看门狗喂狗间隔的设置<br>6.1.2.2 让添加延长看门狗喂狗间隔的设置生效<br>6.1.3 让 softlockup 触发后直接宕机<br>6.2 禁止图形系统桌面的 DNS 和路由以避免系统崩溃<br>6.2.1 添加禁止图形系统桌面的 DNS 和路由的设置<br>6.2.2 让禁止图形系统桌面的 DNS 和路由的设置生效<br>6.3 禁止图形系统界面自动黑屏或自动挂起<br>6.4 让 SSH 联接永久不超时<br>6.4.1 让 SSH 服务端的连接不超时<br>6.4.2 让用户登陆永不超时<br>6.4.2.1 在系统文件里添加让用户登陆永不超时的设置<br>6.4.2.2 让用户登陆永不超时的设置立刻生效<br>6.5 删除不需要的软件包以避免 CPU 占用过高而崩溃（选做）</h4>



<h4>步骤七：搭建虚拟化平台</h4>



<h4>步骤八：实现文件共享<br>8.1 安装 Samba 服务<br>8.2 配置 Samba 服务的配置文件<br>8.3 设置 Samba 服务共享用户<br>8.3.1 给 Samba 服务共享用户设置 Samba 共享密码<br>8.3.2 查看 Samba 服务共享用户是否可用<br>8.4 生成 Samba 服务共享目录<br>8.4.1 生成 Samba 服务共享目录<br>8.4.2 给 Samba 服务共享目录设置权限<br>8.4.3 给 Samba 服务共享目录设置所属主和所属组<br>8.4.4 给 Samba 服务共享目录设置 selinux 标签<br>8.4.5 让 Samba 服务共享目录上的 selinux 标签立刻生效<br>8.5 启动 Samba 服务并设置为开机自动启动<br>8.6 在系统防火墙开放 Samba 的端口<br>8.6.1 在系统防火墙开放 Samba 的端口<br>8.6.2 让系统防火墙重新加载</h4>



<h4>步骤九：实现远程桌面<br>9.1 安装 vnc 服务<br>9.2 设置 VNC 服务共享用户<br>9.2.1 进入用户<br>9.2.2 给 VNC 服务共享用户设置 VNC 远程密码<br>9.2.3 退出用户<br>9.3 启动 VNC 并设置为开机自动启动<br>9.3.1 创建开启 VNC 的脚本 ~/vnc.sh<br>9.3.1.1 进入到用户<br>9.3.1.2 创建开启 VNC 的脚本 ~/vnc.sh<br>9.3.1.3 退出用户<br>9.3.2 执行开启 VNC 的脚本<br>9.3.2.1 开机执行开启 VNC 的脚本<br>9.3.2.1.1 配置开机执行的文件<br>9.3.2.1.2 给开机执行的文件执行权限<br>9.3.2.2 定期执行开启 VNC 的脚本<br>9.3.2.2.1 进入到用户<br>9.3.2.2.2 配置定期执行的文件<br>9.3.2.2.3 退出用户</h4>



<h4>步骤十：设置 SSH 内网穿透<br>10.1 生成 SSH 密钥<br>10.1.1 进入到用户<br>10.1.2 生成 SSH 密钥<br>10.1.3 退出用户<br>10.2 实现无密钥 SSH<br>10.2.1 进入到用户<br>10.2.2 让电脑可以无密钥 SSH VPS<br>10.2.3 让 VPS 可以无密钥 SSH 自己<br>10.2.4 让客户端可以远程 VPS 和电脑<br>10.2.5 退出用户<br>10.3 建立电脑到 VPS 的 SSH 隧道并设置为开机自启<br>10.3.1 创建建立电脑到 VPS 的 SSH 隧道的脚本 ～/ssh.sh<br>10.3.1.1 进入到用户<br>10.3.1.2 创建建立电脑到 VPS 的 SSH 隧道的脚本 ～/ssh.sh<br>10.3.1.3 退出用户<br>10.3.2 执行电脑到 VPS 的 SSH 隧道的脚本<br>10.3.2.1 开机执行开启电脑到 VPS 的 SSH 隧道的脚本<br>10.3.2.1.1 配置开机执行的文件<br>10.3.2.1.2 给开机执行的文件执行权限<br>10.3.3 定期执行电脑到 VPS 的 SSH 隧道的脚本<br>10.3.3.1 进入到用户<br>10.3.3.2 配置定期执行的文件<br>10.3.3.3 退出用户<br>10.4 建立 VPS 的 SSH 隧道端口映射并设置为开机自启<br>10.4.1 创建建立 VPS 的 SSH 隧道端口映射的脚本<br>10.4.1.1 进入到用户<br>10.4.1.2 创建建立 VPS 的 SSH 隧道端口映射的脚本<br>10.4.1.3 退出用户<br>10.4.2 执行电脑到 VPS 的 SSH 隧道的脚本<br>10.4.2.1 开机执行开启电脑到 VPS 的 SSH 隧道的脚本<br>10.4.2.1.1 配置开机执行的文件<br>10.4.2.1.2 给开机执行的文件执行权限<br>10.4.3 定期执行电脑到 VPS 的 SSH 隧道的脚本<br>10.4.3.1 进入到用户<br>10.4.3.2 配置定期执行的文件<br>10.4.4 退出用户<br>10.4.5 打开外网 VPS 对应端口的防火墙<br>10.4.5.1 打开外网 VPS 对应端口的防火墙<br>10.4.5.2 让刚刚外网 VPS 刚刚配置的防火墙生效</h4>



<h4>步骤十一：加强 SSH 的安全性（选做）<br>11.1 禁止 root 被 SSH（选做）<br>11.2 禁止使用密码被 SSH（选做）</h4>



<h4>步骤十二：私有远程桌面和虚拟化平台的使用<br>12.1 客户端 SSH 联接电脑的方法<br>12.1.1 客户端和电脑不在同一内网时<br>12.1.2 客户端和电脑在同一内网时<br>12.2 客户端使用电脑虚拟化平台的的方法<br>12.2.1 客户端和电脑不在同一内网时<br>12.2.1.1 在客户端上联接电脑<br>12.2.1.2 通过 ssh 开启虚拟化图形管理平台<br>12.2.2 客户端和电脑在同一内网时<br>12.2.2.1 在客户端上联接电脑<br>12.2.2.2 通过 ssh 开启虚拟化图形管理平台<br>12.3 客户端使用私有远程桌面的方法<br>12.3.1 客户端和电脑不在同一内网时<br>12.3.2 客户端和电脑在同一内网时<br>12.4 客户端在内网和电脑互传数据的方法<br>12.4.1 在 Windows 图形客户端上和电脑互传数据的方法<br>12.4.2 在 Linux 图形客户端上和电脑互传数据的方法</h4>



<h4>步骤十三：客户端直接使用公网 IP 地址联接电脑<br>13.1 实现此步骤所需环境<br>13.2 在路由器上将电脑上的 22 端口映射到路由器上的公网 IP 地址上，这样路由器上的公网 IP 地址就变成电脑的公网 IP 地址了<br>13.3 将电脑的公网 IP 地址放到 VPS 上<br>13.3.1 将电脑的公网 IP 地址放到 VPS 上的意义<br>13.3.2 创建将电脑的公网 IP 地址放到 VPS 上的脚本<br>13.3.2.1 进入到用户用户<br>13.3.2.2 创建将电脑的公网 IP 地址放到 VPS 上的脚本<br>13.3.2.3 退出用户用户<br>13.3.3 执行将电脑的公网 IP 地址放到 VPS 上的脚本<br>13.3.3.1 进入到用户用户<br>13.3.3.2 配置定期执行的文件<br>13.3.3.3 退出用户用户<br>13.4 通过 DDNS 服务查看电脑的公网 IP<br>13.4.1 通过 DDNS 服务查看电脑的公网 IP<br>13.4.2 有些 DDNS 服务可以在网关路由器上设置，并且通过手机 APP 查看现在的公网 IP 地址</h4>



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



<h4>步骤一：规划拓扑<br>1.1 电脑列表</h4>



<p>1) 一台可以联接公网的电脑<br>2) 一个 CentOS 8.2 系统的安装 U 盘<br>3) 一台可以联接公网并且有公网 IP 地址的 VPS<br>4) 一个可以联接公网并使用 SSH 和 VNC 的客户端</p>



<h4>1.2 服务器列表简介</h4>



<p>1) 电脑通过 SSH 建立联接到 VPS 的隧道，此操作会占用 VPS 的一个端口<br>2) VPS 通过 SSH 将联接电脑的隧道端口映射到一个新的端口<br>3) 客户端通过 SSH 联接到 VPS 映射出来的新端口，通过 SSH 或远程桌面使用虚拟化平台<br>4) 客户端和电脑如果在同一内网里则可以通过 Samba 互传数据</p>



<h4>步骤二：CentOS 8.2 系统的安装 U 盘给电脑安装系统</h4>



<p>（只在电脑上执行以下步骤）<br>（步骤略）</p>



<p>（<br>补充：<br>安装系统时可选择以下选项：<br>1) 系统起动方式：BIOS<br>2) Keyboard：English(US)<br>3) Language Support：English(United States)<br>4) Time &amp; Date：Asia/ShangHai<br>5) Installation Source：Local media<br>6) Software Selection：Minial Install<br>7) Installation Destination：将主硬盘里的所有空间都分配给根分区<br>8) KDUMP：Kdump is disabled<br>9) Network &amp; Host Name：开启网络联接并设置好固定 DNS<br>10) SECURITY POLICY：No controller found<br>）</p>



<p>（这里以将 IP 地址设置为固定 IP 地址 192.168.0.1，DNS 设置为固定 DNS 8.8.8.8 为例）</p>



<h4>步骤三：安装图形系统桌面</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code># yum groupinstall -y "Server with GUI"</code></pre>



<h4>步骤四：安装中文输入法<br>4.1 安装中文库</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>4.2 确认中文库已经安装</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>4.3 安装中文输入法</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>步骤五：创建用户用户<br>5.1 创建用户用户</h4>



<p>（分别在电脑、VPS 和客户端上执行以下步骤）</p>



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



<p>（补充：这里创建用户 zhumingyu 为例）</p>



<h4>5.2 给用户用户设置密码</h4>



<p>（分别在电脑、VPS 和客户端上执行以下步骤）</p>



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



<p>（补充：这里创建用户 zhumingyu 为例）</p>



<h4>步骤六：增加 CentOS 系统的稳定性<br>6.1 延长看门狗喂狗间隔以减少系统被软锁出现 softlockup 的几率<br>6.1.1 临时延长看门狗喂狗间隔的时间</h4>



<p>（分别在电脑和 VPS 上执行以下步骤）</p>



<pre class="wp-block-code"><code># sysctl -w kernel.watchdog_thresh=60</code></pre>



<h4>6.1.2 永久延长看门狗喂狗间隔的时间<br>6.1.2.1 添加延长看门狗喂狗间隔的设置</h4>



<p>（只在电脑上执行以下步骤）</p>



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



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



<pre class="wp-block-code"><code>......
kernel.watchdog_thresh=60</code></pre>



<h4>6.1.2.2 让添加延长看门狗喂狗间隔的设置生效</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>6.1.3 让 softlockup 触发后直接宕机</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>6.2 禁止图形系统桌面的 DNS 和路由以避免系统崩溃<br>6.2.1 添加禁止图形系统桌面的 DNS 和路由的设置</h4>



<p>（分别在电脑和 VPS 上执行以下步骤）</p>



<pre class="wp-block-code"><code># vim /etc/sysconfig/network-scripts/ifcfg-enp9s0</code></pre>



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



<pre class="wp-block-code"><code>......
PEERDNS=no
PEERROUTES=no</code></pre>



<p>（补充：这里的 ifcfg-enp9s0 是指网卡对应的配置文件，不同的网卡对应的配置文件不同，这里以网卡名 ifcfg-enp9s0 为例，需要给所有网卡添加此参数，这一步也可以在系统图形系统桌面上设置）</p>



<h4>6.2.2 让禁止图形系统桌面的 DNS 和路由的设置生效</h4>



<p>（分别在电脑和 VPS 上执行以下步骤）</p>



<pre class="wp-block-code"><code># systemctl restart NetworkManager</code></pre>



<h4>6.3 禁止图形系统界面自动黑屏或自动挂起</h4>



<p>（只在电脑上执行以下步骤）</p>



<h4>6.4 让 SSH 联接永久不超时<br>6.4.1 让 SSH 服务端的连接不超时</h4>



<p>（分别在电脑和 VPS 上执行以下步骤）</p>



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



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



<pre class="wp-block-code"><code>......
#ClientAliveInterval 0
#ClientAliveCountMax 3
......</code></pre>



<p>修改为：</p>



<pre class="wp-block-code"><code>......
ClientAliveInterval 60
ClientAliveCountMax 525600
......</code></pre>



<p>（补充：这样设置会让 SSH 服务端每 60s 就会尝试连接一次客户端，如果 525600 次后没有回应，则断开）</p>



<h4>6.4.2 让用户登陆永不超时<br>6.4.2.1 在系统文件里添加让用户登陆永不超时的设置</h4>



<p>（分别在电脑和 VPS 上执行以下步骤）</p>



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



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



<pre class="wp-block-code"><code>......
export TMOUT=0</code></pre>



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



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



<pre class="wp-block-code"><code>......
export TMOUT=0</code></pre>



<h4>6.4.2.2 让用户登陆永不超时的设置立刻生效</h4>



<p>（分别在电脑和 VPS 上执行以下步骤）</p>



<pre class="wp-block-code"><code># source /etc/bashrc
# source /etc/profile</code></pre>



<h4>6.5 删除不需要的软件包以避免 CPU 占用过高而崩溃（选做）</h4>



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



<h4>步骤七：搭建虚拟化平台</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code># yum -y install qemu-kvm libvirt-daemon libvirt-client libvirt-daemon-driver-qemu virt-install virt-manager virt-viewer virt-v2v</code></pre>



<h4>步骤八：实现文件共享<br>8.1 安装 Samba 服务</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>8.2 配置 Samba 服务的配置文件</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<p>将全部内容修改如下：</p>



<pre class="wp-block-code"><code># See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.

&#91;global]
workgroup = WORKGROUP
realm = zhumingyu
netbios name = zhumingyu
#encrypt passwords = yes
map to guest = NEVER
security = user
password server = *
name resolve order = bcast host
restrict anonymous = 2
#null passwords = no
#guest account = smb_nobody
#use spnego = yes
client use spnego = yes
server string = ""
host msdfs = no
msdfs root = no
domain master = no
preferred master = no
local master = no
os level = 0
browse list = no
browseable = no
dns proxy = no
wide links = no
public= no
guest ok = no
hosts deny = ALL EXCEPT 192.168.0.2

&#91;share]
valid users = zhumingyu
write list = zhumingyu
read list = zhumingyu
path = /share
guest ok = no
read only = no
browseable = no
writable = yes
public = no
create mask = 0755
directory mask = 0755</code></pre>



<p>（<br>补充：<br>1) 这里以 Samba 服务器的 IP 地址是 192.168.0.1 为例<br>2) 这里的 workgroup = WORKGROUP 是让 Samba 服务属于 WORKGROUP<br>3) 这里的 hosts deny = ALL EXCEPT 192.168.0.2 是只让客户端 192.168.0.3 能够访问服务端的 Samba<br>4) 这里的 sharetest 是这个 Samba 挂载点的名称，挂载这个挂载点的格式就是：//192.168.0.1/share<br>5) 这里的 valid users = zhumingyu 是 Samba 服务共享用户需要手动生成<br>6) 这里的 path = /share 是 Samba 服务共享目录需要手动生成<br>）</p>



<h4>8.3 设置 Samba 服务共享用户<br>8.3.1 给 Samba 服务共享用户设置 Samba 共享密码</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code># smbpasswd -a zhumingyu</code></pre>



<p>（补充：这里以用户 zhumingyu 为例）</p>



<h4>8.3.2 查看 Samba 服务共享用户是否可用</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>8.4 生成 Samba 服务共享目录<br>8.4.1 生成 Samba 服务共享目录</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>8.4.2 给 Samba 服务共享目录设置权限</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code># chmod 755 /share/</code></pre>



<h4>8.4.3 给 Samba 服务共享目录设置所属主和所属组</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code># chown zhumingyu:zhumingyu /share/</code></pre>



<p>（补充：这里以用户 zhumingyu 为例）</p>



<h4>8.4.4 给 Samba 服务共享目录设置 selinux 标签</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code># semanage fcontext -a -t samba_share_t '/share(/.*)?'</code></pre>



<h4>8.4.5 让 Samba 服务共享目录上的 selinux 标签立刻生效</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>8.5 启动 Samba 服务并设置为开机自动启动</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>8.6 在系统防火墙开放 Samba 的端口<br>8.6.1 在系统防火墙开放 Samba 的端口</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code># firewall-cmd --add-service=samba --permanent</code></pre>



<h4>8.6.2 让系统防火墙重新加载</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code># firewall-cmd --reload</code></pre>



<h4>步骤九：实现远程桌面<br>9.1 安装 vnc 服务</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>9.2 设置 VNC 服务共享用户<br>9.2.1 进入用户</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<p>（补充：这里以用户 zhumingyu 为例）</p>



<h4>9.2.2 给 VNC 服务共享用户设置 VNC 远程密码</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>9.2.3 退出用户</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>9.3 启动 VNC 并设置为开机自动启动<br>9.3.1 创建开启 VNC 的脚本 ~/vnc.sh<br>9.3.1.1 进入到用户</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<p>（补充：这里以用户 zhumingyu 为例）</p>



<h4>9.3.1.2 创建开启 VNC 的脚本 ~/vnc.sh</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code>$ vim ~/vnc.sh</code></pre>



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



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

vncserver -list | grep :1 &amp;&gt; /dev/null || vncserver :1 -localhost -nolisten tcp</code></pre>



<p>（补充：此命令会检查 vncserver :1 会话是否存在，如果不存在，就以禁止非安全远程登陆的方式创建一个）</p>



<h4>9.3.1.3 退出用户</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>9.3.2 执行开启 VNC 的脚本<br>9.3.2.1 开机执行开启 VNC 的脚本<br>9.3.2.1.1 配置开机执行的文件</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code># vim /etc/rc.local</code></pre>



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



<pre class="wp-block-code"><code>......
su - zhumingyu -c '/home/zhumingyu/vnc.sh'</code></pre>



<p>（补充：这里以用户 zhumingyu 的身份运行）</p>



<p>或者：</p>



<pre class="wp-block-code"><code>......
su - zhumingyu -c 'vncserver -list | grep :1' &amp;&gt; /dev/null || su - zhumingyu -c 'vncserver :1 -localhost -nolisten tcp'</code></pre>



<p>（<br>补充：<br>1) 如果前面没有创建脚本的话，可以只添加上面“或者”后面的这一行<br>2) 以用户 zhumingyu 的身份运行<br>3) 此命令会检查 vncserver :1 会话是否存在，如果不存在，就以禁止非安全远程登陆的方式创建一个<br>）</p>



<h4>9.3.2.1.2 给开机执行的文件执行权限</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code># chmod u+x /home/zhumingyu/vnc.sh</code></pre>



<h4>9.3.2.2 定期执行开启 VNC 的脚本<br>9.3.2.2.1 进入到用户</h4>



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



<p>（补充：这里以用户 zhumingyu 为例）</p>



<h4>9.3.2.2.2 配置定期执行的文件</h4>



<p>（只在电脑上执行以下步骤）</p>



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



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



<pre class="wp-block-code"><code>......
0 */1 * * * /home/zhumingyu/vnc.sh</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code>......
0 */1 * * * vncserver -list | grep :1' &amp;&gt; /dev/null || su - zhumingyu -c 'vncserver :1 -localhost -nolisten tcp</code></pre>



<p>（<br>补充：<br>1) 这里以用户 zhumingyu 的身份运行<br>2) 如果前面没有创建脚本的话，可以只添加上面“或者”后面的这一行<br>3) 此命令会检查 vncserver :1 会话是否存在，如果不存在，就以禁止非安全远程登陆的方式创建一个<br>）</p>



<h4>9.3.2.2.3 退出用户</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>步骤十：设置 SSH 内网穿透<br>10.1 生成 SSH 密钥<br>10.1.1 进入到用户</h4>



<p>（分别在电脑、VPS 和客户端上执行以下步骤）</p>



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



<p>（补充：这里以用户 zhumingyu 为例）</p>



<h4>10.1.2 生成 SSH 密钥</h4>



<p>（分别在电脑、VPS 和客户端上执行以下步骤）</p>



<pre class="wp-block-code"><code>$ ssh-keygen -b 2048 -t rsa</code></pre>



<p>（补充：建议在创建 SSH 密钥时为 SSH 密钥添加一个密码）</p>



<h4>10.1.3 退出用户</h4>



<p>（分别在电脑、VPS 和客户端上执行以下步骤）</p>



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



<h4>10.2 实现无密钥 SSH<br>10.2.1 进入到用户</h4>



<p>（分别在电脑、VPS 和客户端上执行以下步骤）</p>



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



<p>（补充：这里以用户 zhumingyu 为例）</p>



<h4>10.2.2 让电脑可以无密钥 SSH VPS</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code>$ ssh-copy-id &lt;public IP address of VPS&gt;</code></pre>



<h4>10.2.3 让 VPS 可以无密钥 SSH 自己</h4>



<p>（只在 VPS 上执行以下步骤）</p>



<pre class="wp-block-code"><code>$ ssh-copy-id localhost</code></pre>



<h4>10.2.4 让客户端可以远程 VPS 和电脑</h4>



<pre class="wp-block-code"><code>$ ssh-copy-id &lt;IP address of computer&gt;
$ ssh-copy-id &lt;public IP address of VPS&gt;</code></pre>



<h4>10.2.5 退出用户</h4>



<p>（分别在电脑、VPS 和客户端上执行以下步骤）</p>



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



<h4>10.3 建立电脑到 VPS 的 SSH 隧道并设置为开机自启<br>10.3.1 创建建立电脑到 VPS 的 SSH 隧道的脚本 ～/ssh.sh<br>10.3.1.1 进入到用户</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<p>（补充：这里以用户 zhumingyu 为例）</p>



<h4>10.3.1.2 创建建立电脑到 VPS 的 SSH 隧道的脚本 ～/ssh.sh</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code>$ vim ～/ssh.sh</code></pre>



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



<pre class="wp-block-code"><code>ps -aux | grep -v grep | grep "11000:localhost:22 &lt;IP address of computer&gt;" &amp;&gt; /dev/null || ssh -X -fCNR 11000:localhost:22 &lt;IP address of computer&gt;</code></pre>



<p>（<br>补充：<br>1) 这里以用户 zhumingyu 的身份运行<br>2) 如果 11000 端口没有影射到 22 端口则影射<br>）</p>



<h4>10.3.1.3 退出用户</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>10.3.2 执行电脑到 VPS 的 SSH 隧道的脚本<br>10.3.2.1 开机执行开启电脑到 VPS 的 SSH 隧道的脚本<br>10.3.2.1.1 配置开机执行的文件</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code># vim /etc/rc.local</code></pre>



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



<pre class="wp-block-code"><code>......
su - zhumingyu -c '/home/zhumingyu/ssh.sh'</code></pre>



<p>（补充：这里以用户 zhumingyu 的身份运行）</p>



<p>或者：</p>



<pre class="wp-block-code"><code>......
ps -aux | grep -v grep | grep "11000:localhost:22 &lt;IP address of computer&gt;" &amp;&gt; /dev/null || su - zhumingyu -c 'ssh -X -fCNR 11000:localhost:22 &lt;IP address of computer&gt;'</code></pre>



<p>（<br>补充：<br>1) 如果前面没有创建脚本的话，可以只添加上面“或者”后面的这一行<br>2) 这里以用户 zhumingyu 的身份运行<br>3) 如果 11000 端口没有影射到 22 端口则影射<br>）</p>



<h4>10.3.2.1.2 给开机执行的文件执行权限</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code># chmod +x /etc/rc.local</code></pre>



<h4>10.3.3 定期执行电脑到 VPS 的 SSH 隧道的脚本<br>10.3.3.1 进入到用户</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<p>（补充：这里以 zhumingyu 为例）</p>



<h4>10.3.3.2 配置定期执行的文件</h4>



<p>（只在电脑上执行以下步骤）</p>



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



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



<pre class="wp-block-code"><code>......
0 */1 * * * /home/zhumingyu/ssh.sh</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code>......
0 */1 * * * ps -aux | grep -v grep | grep "11000:localhost:22 &lt;IP address of computer&gt;" &amp;&gt; /dev/null || ssh -X -fCNR 11000:localhost:22 &lt;IP address of computer&gt;</code></pre>



<p>（补充：如果 11000 端口影射到 22 端口则影射）</p>



<h4>10.3.3.3 退出用户</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>10.4 建立 VPS 的 SSH 隧道端口映射并设置为开机自启<br>10.4.1 创建建立 VPS 的 SSH 隧道端口映射的脚本<br>10.4.1.1 进入到用户</h4>



<p>（只在 VPS 上执行以下步骤）</p>



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



<p>（补充：这里以用户 zhumingyu 为例）</p>



<h4>10.4.1.2 创建建立 VPS 的 SSH 隧道端口映射的脚本</h4>



<p>（只在 VPS 上执行以下步骤）</p>



<pre class="wp-block-code"><code>$ vim ~/sshd.sh</code></pre>



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



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

ps -aux | grep -v grep | grep "*:10000:localhost:11000 localhost" || ssh -X -fCNL *:10000:localhost:11000 localhost</code></pre>



<p>（补充：如果 11000 端口没有影射成 10000 端口则影射）</p>



<h4>10.4.1.3 退出用户</h4>



<p>（只在 VPS 上执行以下步骤）</p>



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



<h4>10.4.2 执行电脑到 VPS 的 SSH 隧道的脚本<br>10.4.2.1 开机执行开启电脑到 VPS 的 SSH 隧道的脚本<br>10.4.2.1.1 配置开机执行的文件</h4>



<p>（只在 VPS 上执行以下步骤）</p>



<pre class="wp-block-code"><code># vim /etc/rc.local</code></pre>



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



<pre class="wp-block-code"><code>......
su - zhumingyu -c '/home/zhumingyu/sshd.sh'</code></pre>



<p>（补充：这里以用户 zhumingyu 为例）</p>



<p>或者：</p>



<pre class="wp-block-code"><code>......
ps -aux | grep -v grep | grep "*:10000:localhost:11000 localhost" || su - zhumingyu -c 'ssh -X -fCNL *:10000:localhost:11000 localhost'</code></pre>



<p>（<br>补充：<br>1) 如果前面没有创建脚本的话，可以只添加上面“或者”后面的这一行<br>2) 以用户 zhumingyu 的身份运行<br>3) 如果 11000 端口没有影射成 10000 端口则影射<br>）</p>



<h4>10.4.2.1.2 给开机执行的文件执行权限</h4>



<p>（只在 VPS 上执行以下步骤）</p>



<pre class="wp-block-code"><code># chmod +x /etc/rc.local</code></pre>



<h4>10.4.3 定期执行电脑到 VPS 的 SSH 隧道的脚本<br>10.4.3.1 进入到用户用户</h4>



<p>（只在 VPS 上执行以下步骤）</p>



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



<p>（补充：这里以用户 zhumingyu 为例）</p>



<h4>10.4.3.2 配置定期执行的文件</h4>



<p>（只在 VPS 上执行以下步骤）</p>



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



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



<pre class="wp-block-code"><code>......
0 */1 * * * /home/zhumingyu/sshd.sh</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code>......
0 */1 * * * ps -aux | grep -v grep | grep "*:10000:localhost:11000 localhost" || ssh -X -fCNL *:10000:localhost:11000 localhost</code></pre>



<p>（<br>补充：<br>1) 如果前面没有创建脚本的话，可以只添加上面“或者”后面的这一行<br>2) 如果 11000 端口没有影射成 10000 端口则影射<br>）</p>



<h4>10.4.4 退出用户</h4>



<p>（只在 VPS 上执行以下步骤）</p>



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



<h4>10.4.5 打开外网 VPS 对应端口的防火墙<br>10.4.5.1 打开外网 VPS 对应端口的防火墙</h4>



<p>（只在 VPS 上执行以下步骤）</p>



<pre class="wp-block-code"><code># firewall-cmd --add-port=10000/tcp --permanent</code></pre>



<p>（补充：这里打开的端口号，是根据前面的设置而定的）</p>



<h4>10.4.5.2 让刚刚外网 VPS 刚刚配置的防火墙生效</h4>



<p>（只在 VPS 上执行以下步骤）</p>



<pre class="wp-block-code"><code># firewall-cmd --reload</code></pre>



<h4>步骤十一：加强 SSH 的安全性（选做）<br>11.1 禁止 root 被 SSH（选做）</h4>



<p>（分别在电脑和 VPS 上执行以下步骤）</p>



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



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



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



<p>修改为：</p>



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



<h4>11.2 禁止使用密码被 SSH（选做）</h4>



<p>（分别在电脑和 VPS 上执行以下步骤）</p>



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



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



<pre class="wp-block-code"><code>......
# PasswordAuthentication yes
......</code></pre>



<p>修改为：</p>



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



<h4>步骤十二：私有远程桌面和虚拟化平台的使用<br>12.1 客户端 SSH 联接电脑的方法<br>12.1.1 客户端和电脑不在同一内网时</h4>



<p>（只在客户端上执行以下步骤）</p>



<pre class="wp-block-code"><code># ssh -X -p &lt;SSH non standard port number&gt; &lt;user of computer&gt;@&lt;public IP address of VPS&gt;</code></pre>



<p>（<br>补充：<br>1) 如果按照前面的步骤操作，这里的 VPS 每小时会生成一个新的 SSH 非标准端口号以用于联接电脑，比如说现在是 14 点，那就会自动生成一个 11014 的 SSH 非标准端口号<br>2) 如果按照前面的步骤操作，这里的用户是 zhumingyu<br>）</p>



<h4>12.1.2 客户端和电脑在同一内网时</h4>



<p>（只在客户端上执行以下步骤）</p>



<pre class="wp-block-code"><code># ssh -X &lt;user of computer&gt;@&lt;IP address of computer&gt;</code></pre>



<p>（<br>补充：<br>1) 如果按照前面的步骤操作，这里的用户用户是 zhumingyu<br>2) 如果按照前面的步骤操作，这里的电脑的 IP 地址是 192.168.0.1<br>）</p>



<h4>12.2 客户端使用电脑虚拟化平台的的方法<br>12.2.1 客户端和电脑不在同一内网时<br>12.2.1.1 在客户端上联接电脑</h4>



<p>（只在客户端上执行以下步骤）</p>



<pre class="wp-block-code"><code># ssh -X -p &lt;SSH non standard port number&gt; &lt;user of computer&gt;@&lt;public IP address of VPS&gt;</code></pre>



<p>（<br>补充：<br>1) 如果按照前面的步骤操作，这里的 VPS 每小时会生成一个新的 SSH 非标准端口号以用于联接电脑，比如说现在是 14 点，那就会自动生成一个 11014 的 SSH 非标准端口号<br>2) 如果按照前面的步骤操作，这里的用户用户是 zhumingyu<br>）</p>



<h4>12.2.1.2 通过 ssh 开启虚拟化图形管理平台</h4>



<p>（只在客户端上执行以下步骤）</p>



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



<p>（注意：网络带宽很小则远程桌面会比较卡，建议电脑、客户端和 VPS 的带宽 2m 以上）</p>



<h4>12.2.2 客户端和电脑在同一内网时<br>12.2.2.1 在客户端上联接电脑</h4>



<p>（只在客户端上执行以下步骤）</p>



<pre class="wp-block-code"><code># ssh -X &lt;user of computer&gt;@&lt;IP address of computer&gt;</code></pre>



<p>（<br>补充：<br>1) 如果按照前面的步骤操作，这里的用户用户是 zhumingyu<br>2) 如果按照前面的步骤操作，这里的电脑的 IP 地址是 192.168.0.1<br>）</p>



<h4>12.2.2.2 通过 ssh 开启虚拟化图形管理平台</h4>



<p>（只在客户端上执行以下步骤）</p>



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



<p>（注意：网络带宽很小则远程桌面会比较卡，建议电脑、客户端和 VPS 的带宽 2m 以上）</p>



<h4>12.3 客户端使用私有远程桌面的方法<br>12.3.1 客户端和电脑不在同一内网时</h4>



<p>（只在客户端上执行以下步骤）</p>



<pre class="wp-block-code"><code># ssh -p &lt;SSH non standard port number&gt; -L &lt;port number of VNC&gt;:localhost:&lt;port number of VNC&gt; -l &lt;user of computer&gt; &lt;public IP address of VPS&gt;</code></pre>



<p>（<br>补充：<br>1) 如果按照前面的步骤操作，这里的 VPS 每小时会生成一个新的 SSH 非标准端口号以用于联接电脑，比如说现在是 14 点，那就会自动生成一个 11014 的 SSH 非标准端口号<br>2) 如果按照前面的步骤操作，这里的 VNC 的端口号是 5901<br>3) 如果按照前面的步骤操作，这里的电脑的用户用户是 zhumingyu<br>）</p>



<p>另开启一个命令行终端：</p>



<pre class="wp-block-code"><code># vncviewer localhost :&lt;number of VNC service&gt;</code></pre>



<p>（补充：如果按照前面的步骤操作，这里的 VNC 服务的编号是 1）</p>



<p>（注意：网络带宽很小则远程桌面会比较卡，建议电脑、客户端和 VPS 的带宽 2m 以上）</p>



<h4>12.3.2 客户端和电脑在同一内网时</h4>



<p>（只在客户端上执行以下步骤）</p>



<pre class="wp-block-code"><code># vncviewer -via &lt;user of computer&gt;@&lt;IP address of computer&gt; localhost :&lt;number of VNC service&gt;</code></pre>



<p>（<br>补充：<br>1) 如果按照前面的步骤操作，这里的电脑的用户是 zhumingyu<br>2) 如果按照前面的步骤操作，这里的电脑的 IP 地址是 192.168.0.1<br>3) 如果按照前面的步骤操作，这里的 VNC 服务的编号是 1<br>）</p>



<h4>12.4 客户端在内网和电脑互传数据的方法<br>12.4.1 在 Windows 图形客户端上和电脑互传数据的方法</h4>



<p>（只在客户端上执行以下步骤）</p>



<p>在文件目录下栏输入以下内容：</p>



<pre class="wp-block-code"><code>\\&lt;IP address of computer&gt;\&lt;samba directory&gt;</code></pre>



<p>（<br>补充：<br>1) 如果按照前面的步骤操作，这里的电脑的 IP 地址是 192.168.0.1<br>2) 如果按照前面的步骤操作，这里的 Samba 项目是 share<br>）</p>



<p>（<br>注意：<br>1) 如果按照前面的步骤操作，只有 IP 地址是 192.168.0.2 和 192.168.0.3 的客户端才能够执行以上步骤<br>2) Windows 客户端建议安装 SecureCRT、Xmanager 和 VNC 客户端以实现 ssh、ssh 调用 virt-manager 和 VNC<br>）</p>



<h4>12.4.2 在 Linux 图形客户端上和电脑互传数据的方法</h4>



<p>（只在客户端上执行以下步骤）</p>



<p>在文件 &#8211;&gt; 其他位置 &#8211;&gt; 连接到服务器的地址栏里输入以下内容：</p>



<pre class="wp-block-code"><code>smb://&lt;IP address of computer&gt;/&lt;samba directory&gt;</code></pre>



<p>（<br>补充：<br>1) 如果按照前面的步骤操作，这里的电脑的 IP 地址是 192.168.0.1<br>2) 如果按照前面的步骤操作，这里的 Samba 项目是 share<br>）</p>



<p>（注意：如果按照前面的步骤操作，只有 IP 地址是 192.168.0.2 和 192.168.0.3 的客户端才能够执行以上步骤）</p>



<h4>步骤十三：客户端直接使用公网 IP 地址联接电脑<br>13.1 实现此步骤所需环境</h4>



<p>网关路由器拥有 IP 地址（可以通过给宽带申请公网 IP 地址并将光纤盒设置为桥接模式，在路由器上添加用户和密码实现）</p>



<h4>13.2 在路由器上将电脑上的 22 端口映射到路由器上的公网 IP 地址上，这样路由器上的公网 IP 地址就变成电脑的公网 IP 地址了</h4>



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



<h4>13.3 将电脑的公网 IP 地址放到 VPS 上<br>13.3.1 将电脑的公网 IP 地址放到 VPS 上的意义</h4>



<p>由于大多数的公网 IP 地址都是动态，定期会变，所以可以通过此方法知道近期的公网 IP 地址是多少</p>



<h4>13.3.2 创建将电脑的公网 IP 地址放到 VPS 上的脚本<br>13.3.2.1 进入到用户</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<p>（补充：这里以用户 zhumingyu 为例）</p>



<h4>13.3.2.2 创建将电脑的公网 IP 地址放到 VPS 上的脚本</h4>



<p>（只在电脑上执行以下步骤）</p>



<pre class="wp-block-code"><code>$ vim /root/computerip.sh</code></pre>



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



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

computerip=`curl ifconfig.me`
domain=&lt;public IP address of VPS&gt;

ssh athenadb.com \"echo `curl ifconfig.me` &gt; /home/zhumingyu/serverip.txt\"</code></pre>



<p>（补充：将电脑的公网 IP 地址拷贝到 VPS 的 /tmp/computerip.txt 文件里为例）</p>



<h4>13.3.2.3 退出用户用户</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>13.3.3 执行将电脑的公网 IP 地址放到 VPS 上的脚本<br>13.3.3.1 进入到用户用户</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<p>（补充：这里以用户 zhumingyu 为例）</p>



<h4>13.3.3.2 配置定期执行的文件</h4>



<p>（只在电脑上执行以下步骤）</p>



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



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



<pre class="wp-block-code"><code>......
0 */10 * * * /home/zhumingyu/.crontab/computerip.txt</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code>......
ssh &lt;public IP address of VPS&gt; \"echo `curl ifconfig.me` &gt; /home/zhumingyu/serverip.txt\"</code></pre>



<p>（<br>补充：<br>1) 如果前面没有创建脚本的话，可以只添加上面“或者”后面的这一行<br>2) 将电脑的公网 IP 地址拷贝到 VPS 的 /home/zhumingyu/serverip.txt 文件里<br>）</p>



<h4>13.3.3.3 退出用户用户</h4>



<p>（只在电脑上执行以下步骤）</p>



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



<h4>13.4 通过 DDNS 服务查看电脑的公网 IP<br>13.4.1 通过 DDNS 服务查看电脑的公网 IP</h4>



<p>由于大多数的公网 IP 地址都是动态，定期会变，所以可以通过此方法知道近期的公网 IP 地址是多少</p>



<h4>13.4.2 有些 DDNS 服务可以在网关路由器上设置，并且通过手机 APP 查看现在的公网 IP 地址</h4>



<p>（步骤略）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux 光纤号的查看</title>
		<link>https://eternalcenter-2021-12.github.io/optical-fiber/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 15 Jul 2020 05:33:29 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=10001</guid>

					<description><![CDATA[步骤目录： 步骤一：查看有哪些光纤号 步骤二：查看光纤号有哪些配置文件 步骤三：查看光纤号配置文件里对应 FC HBA 卡的 WWN 信息 步骤四：查看光纤的状态4.1 光纤正常在线的情况4.2 光纤不正常或者不在线的情况 具体的操作步骤： 步骤一：查看有哪些光纤号 步骤二：查看光纤号有哪些配置文件 步骤三：查看光纤号配置文件里对应 FC HBA 卡的 WWN 信息 步骤四：查看光纤的状态4.1 光纤正常在线的情况 4.2 光纤不正常或者不在线的情况]]></description>
										<content:encoded><![CDATA[
<h2>步骤目录：</h2>



<h4>步骤一：查看有哪些光纤号</h4>



<h4>步骤二：查看光纤号有哪些配置文件</h4>



<h4>步骤三：查看光纤号配置文件里对应 FC HBA 卡的 WWN 信息</h4>



<h4>步骤四：查看光纤的状态<br>4.1 光纤正常在线的情况<br>4.2 光纤不正常或者不在线的情况</h4>



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



<h4>步骤一：查看有哪些光纤号</h4>



<pre class="wp-block-code"><code># lspci | grep -i fibre</code></pre>



<h4>步骤二：查看光纤号有哪些配置文件</h4>



<pre class="wp-block-code"><code># ls /sys/class/fc_host/
host1  host2  host3  host4</code></pre>



<h4>步骤三：查看光纤号配置文件里对应 FC HBA 卡的 WWN 信息</h4>



<pre class="wp-block-code"><code># cat /sys/class/fc_host/host&#91;1-4]/port_name</code></pre>



<h4>步骤四：查看光纤的状态<br>4.1 光纤正常在线的情况</h4>



<pre class="wp-block-code"><code># cat /sys/class/fc_host/host5/port_state
online</code></pre>



<h4>4.2 光纤不正常或者不在线的情况</h4>



<pre class="wp-block-code"><code># cat /sys/class/fc_host/host7/port_state
linkdown</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 nmcli （网络管理）</title>
		<link>https://eternalcenter-2021-12.github.io/nmcli/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 16 Jun 2020 16:30:03 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Network (系统网络)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=9790</guid>

					<description><![CDATA[内容目录： 内容一：整个网络的管理1.1 开启整个网络1.2 关闭整个网络 内容二：管理网络设备2.1 查看网络设备的信息2.1.1 查看所有网络设备2.1.2 查看被激活的网络设备2.2 查看某一个网络设备是否激活2.3 查看网络设备的联通状态2.4 添加网络设备2.5 删除网络设备2.6 激活一个网络设备2.7 取消激活一个网络设备 内容三：IP 地址管理3.1 设置 IP 地址3.1.1 设置 IP 地址的格式3.1.2 设置 IP 地址的案例3.2 让 IP 地址生效3.2.1 让 IP 地址生效的格式3.2.2 让 IP 地址生效的案例 内容四：路由管理4.1 添加路由4.1.1 添加路由的格式4.1.2 添加路由的案例4.2 让路由生效4.2.1 让路由生效的格式4.2.2 让路由生效的案例 具体的内容： 内容一：整个网络的管理1.1 开启整个网络 或者： 1.2 关闭整个网络 或者： 内容二：管理网络设备2.1 查看网络设备的信息2.1.1 查看所有网络设备 或者： 或者： 或者： 2.1.2 &#8230; <p class="link-more"><a href="https://eternalcenter-2021-12.github.io/nmcli/" class="more-link">Continue reading<span class="screen-reader-text"> "[命令] Linux 命令 nmcli （网络管理）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2>内容目录：</h2>



<h4>内容一：整个网络的管理<br>1.1 开启整个网络<br>1.2 关闭整个网络</h4>



<h4>内容二：管理网络设备<br>2.1 查看网络设备的信息<br>2.1.1 查看所有网络设备<br>2.1.2 查看被激活的网络设备<br>2.2 查看某一个网络设备是否激活<br>2.3 查看网络设备的联通状态<br>2.4 添加网络设备<br>2.5 删除网络设备<br>2.6 激活一个网络设备<br>2.7 取消激活一个网络设备</h4>



<h4>内容三：IP 地址管理<br>3.1 设置 IP 地址<br>3.1.1 设置 IP 地址的格式<br>3.1.2 设置 IP 地址的案例<br>3.2 让 IP 地址生效<br>3.2.1 让 IP 地址生效的格式<br>3.2.2 让 IP 地址生效的案例</h4>



<h4>内容四：路由管理<br>4.1 添加路由<br>4.1.1 添加路由的格式<br>4.1.2 添加路由的案例<br>4.2 让路由生效<br>4.2.1 让路由生效的格式<br>4.2.2 让路由生效的案例</h4>



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



<h4>内容一：整个网络的管理<br>1.1 开启整个网络</h4>



<pre class="wp-block-code"><code># nmcli network on</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># nmcli net on</code></pre>



<h4>1.2 关闭整个网络</h4>



<pre class="wp-block-code"><code># nmcli network off</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># nmcli net off</code></pre>



<h4>内容二：管理网络设备<br>2.1 查看网络设备的信息<br>2.1.1 查看所有网络设备</h4>



<pre class="wp-block-code"><code># nmcli connection show</code></pre>



<p>或者：</p>



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



<p>或者：</p>



<pre class="wp-block-code"><code># nmcli con show</code></pre>



<p>或者：</p>



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



<h4>2.1.2 查看被激活的网络设备</h4>



<pre class="wp-block-code"><code># nmcli connection show --active</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># nmcli conneciton --active</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># nmcli con show --active</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># nmcli con --active</code></pre>



<h4>2.2 查看某一个网络设备是否激活</h4>



<pre class="wp-block-code"><code># nmcli device connect &lt;network device name&gt;</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># nmcli dev con &lt;network device name&gt;</code></pre>



<h4>2.3 查看网络设备的联通状态</h4>



<pre class="wp-block-code"><code># nmcli device status</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># nmcli dev status</code></pre>



<h4>2.4 添加网络设备</h4>



<pre class="wp-block-code"><code># nmcli connection add con-name &lt;custom network card alias&gt; ifname &lt;network device name&gt; type ethernet</code></pre>



<p>（补充：这里 con-name 是指要指定一个自定义的网卡别名，ifname 是指要指明网络设备名）</p>



<p>或者：</p>



<pre class="wp-block-code"><code># nmcli con add con-name &lt;custom network card alias&gt; ifname &lt;network device name&gt; type ethernet</code></pre>



<p>（补充：这里 con-name 是指要指定一个自定义的网卡别名，ifname 是指要指明网络设备名）</p>



<h4>2.5 删除网络设备</h4>



<pre class="wp-block-code"><code># nmcli connection delete &lt;custom network card alias&gt;</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># nmcli con del &lt;custom network card alias&gt;</code></pre>



<h4>2.6 激活一个网络设备</h4>



<pre class="wp-block-code"><code># nmcli device connect &lt;network device name&gt;</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># nmcli dev con &lt;network device name&gt;</code></pre>



<h4>2.7 取消激活一个网络设备</h4>



<pre class="wp-block-code"><code># nmcli device disconnect &lt;network device name&gt;</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># nmcli dev dis &lt;network device name&gt;</code></pre>



<h4>内容三：IP 地址管理<br>3.1 设置 IP 地址<br>3.1.1 设置 IP 地址的格式</h4>



<pre class="wp-block-code"><code># nmcli connection modify &lt;custom network card alias&gt; ipv4.address &lt;IP address&gt;/&lt;subnet mask&gt; ipv4.gateway &lt;gateway IP address&gt; ipv4.dns &lt;DNS IP address&gt; autoconnect yes</code></pre>



<h4>3.1.2 设置 IP 地址的案例</h4>



<pre class="wp-block-code"><code># nmcli connection modify eth0 ipv4.address 192.168.1.1/24 ipv4.gateway 192.168.1.1 ipv4.dns 192.168.1.254 autoconnect yes</code></pre>



<p>（补充：这里以添加给 eth0 添加 IP 地址 192.168.1.1/24，网关 192.168.1.1，DNS 192.168.1.254 为例）</p>



<h4>3.2 让 IP 地址生效<br>3.2.1 让 IP 地址生效的格式</h4>



<pre class="wp-block-code"><code># nmcli connection up &lt;custom network card alias&gt;</code></pre>



<h4> 3.2.2 让 IP 地址生效的案例</h4>



<pre class="wp-block-code"><code># nmcli connection down eth0</code></pre>



<h4>内容四：路由管理<br>4.1 添加路由<br>4.1.1 添加路由的格式</h4>



<pre class="wp-block-code"><code># nmcli con mod &lt;custom network card alias&gt; ipv4.routes "&lt;network segment&gt; &lt;gateway IP address&gt;"</code></pre>



<h4>4.1.2 添加路由的案例</h4>



<pre class="wp-block-code"><code># nmcli con mod eth0 ipv4.routes "192.168.2.0/24 192.168.3.1"</code></pre>



<p>（补充：这里以给 eth0 网卡添加 192.168.2.0/24 通过 192.168.3.1 的网关为例）</p>



<h4>4.2 让路由生效<br>4.2.1 让路由生效的格式</h4>



<pre class="wp-block-code"><code># nmcli connection up &lt;custom network card alias&gt;</code></pre>



<h4>4.2.2 让路由生效的案例</h4>



<pre class="wp-block-code"><code># nmcli connection up eth0</code></pre>



<p>（补充：这里以让 eth0 生效为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 网卡速率的查看</title>
		<link>https://eternalcenter-2021-12.github.io/network-speed/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 11 Jun 2020 08:53:07 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Network (系统网络)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=9742</guid>

					<description><![CDATA[方法一：通过网卡当前的工作状态得知 （补充：由上面的输出结果可以得知 ens192 网卡目前工作在 1000baseT/Full 状态） 方法二：通过网卡的型号得知 （补充：由上面的输出结果可以得知，网卡设备为 VMware VMXNET3 Ethernet Controller (rev 01) ，我们可以在网上搜索此设备名以得知此网卡的速率）]]></description>
										<content:encoded><![CDATA[
<h4>方法一：通过网卡当前的工作状态得知</h4>



<pre class="wp-block-code"><code># ethtool ens192
Settings for ens192:
        Supported ports: &#91; TP ]
        Supported link modes:   1000baseT/Full 
                                10000baseT/Full 
        Supported pause frame use: No
        Supports auto-negotiation: No
        Supported FEC modes: Not reported
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 10000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
        MDI-X: Unknown
        Supports Wake-on: uag
        Wake-on: d
        Link detected: yes</code></pre>



<p>（补充：由上面的输出结果可以得知 ens192 网卡目前工作在 1000baseT/Full 状态）</p>



<h4>方法二：通过网卡的型号得知</h4>



<pre class="wp-block-code"><code># lspci -vvv | grep Ethernet
0b:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)
        Subsystem: VMware VMXNET3 Ethernet Controller</code></pre>



<p>（补充：由上面的输出结果可以得知，网卡设备为 VMware VMXNET3 Ethernet Controller (rev 01) ，我们可以在网上搜索此设备名以得知此网卡的速率）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤]  浏览器模块的添加 （SwitchyOmega） （Chrome 版）</title>
		<link>https://eternalcenter-2021-12.github.io/chrome-add-switchyomega/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sun, 12 Apr 2020 14:51:22 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer (系统电脑)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=8738</guid>

					<description><![CDATA[步骤一：下载 SwitchyOmega_Chromium.crx 1.1 登陆网址 https://github.com/FelisCatus/SwitchyOmega/releases1.2 选择对应的 SwitchyOmega 版本1.3 在页面的下方下载 SwitchyOmega_Chromium.crx 步骤二：解压 SwitchyOmega_Chromium.crx 2.1 将 SwitchyOmega_Chromium.crx 的后缀修改为 zip2.2 解压 SwitchyOmega_Chromium.zip 步骤三：添加 SwitchyOmega 模块 3.1 在 Chrome 浏览器中输入网址：chrome://extensions/3.2 打开页面右上角的“开发者模式”3.3 点击“加载已解压的扩展程序”3.4 选择刚刚解压好的 SwitchyOmega_Chromium 文件夹]]></description>
										<content:encoded><![CDATA[
<h4>步骤一：下载 SwitchyOmega_Chromium.crx</h4>



<p>1.1 登陆网址 https://github.com/FelisCatus/SwitchyOmega/releases<br>1.2 选择对应的 SwitchyOmega 版本<br>1.3 在页面的下方下载 SwitchyOmega_Chromium.crx</p>



<h4>步骤二：解压 SwitchyOmega_Chromium.crx</h4>



<p>2.1 将 SwitchyOmega_Chromium.crx 的后缀修改为 zip<br>2.2 解压 SwitchyOmega_Chromium.zip</p>



<h4>步骤三：添加 SwitchyOmega 模块</h4>



<p>3.1 在 Chrome 浏览器中输入网址：chrome://extensions/<br>3.2 打开页面右上角的“开发者模式”<br>3.3 点击“加载已解压的扩展程序”<br>3.4 选择刚刚解压好的 SwitchyOmega_Chromium 文件夹</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 系统的查看 （系统版本和系统位数）</title>
		<link>https://eternalcenter-2021-12.github.io/system-bits-show/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 03 Mar 2020 06:02:36 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Installation (系统安装)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Upgradation (系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=8572</guid>

					<description><![CDATA[内容一：查看系统版本 内容二：查看系统的位数]]></description>
										<content:encoded><![CDATA[
<h4>内容一：查看系统版本</h4>



<pre class="wp-block-code"><code># cat /etc/*release*</code></pre>



<h4>内容二：查看系统的位数</h4>



<pre class="wp-block-code"><code># cat /proc/version</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 iostat  （查看硬盘读写和处理器占用状况） （转载）</title>
		<link>https://eternalcenter-2021-12.github.io/iostat/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 02 Mar 2020 05:48:56 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></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=8555</guid>

					<description><![CDATA[注明：所有转载内容皆直接从被转载文章网页的标题和内容的文本中复制而来]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code>iostat 介绍

iostat用于查看存储设备的IO负载情况，输出信息是指定间隔时间内的平均数据，可以持续输出观察。
通过iostat --help通常看不到直观的信息

&#91;root@master ~]# iostat --help
Usage: iostat &#91; options ] &#91; &lt;interval> &#91; &lt;count> ] ]
Options are:
&#91; -c ] &#91; -d ] &#91; -N ] &#91; -n ] &#91; -h ] &#91; -k | -m ] &#91; -t ] &#91; -V ] &#91; -x ] &#91; -y ] &#91; -z ]
&#91; -j { ID | LABEL | PATH | UUID | ... } &#91; &lt;device> &#91;...] | ALL ] ]
&#91; &lt;device> &#91;...] | ALL ] &#91; -p &#91; &lt;device> &#91;,...] | ALL ] ]

    1
    2
    3
    4
    5
    6

可以通过man iostat来查看该命令的具体解释
man iostat|cat > iostat_help.txt

1.常用的选项

OPTIONS
       -c     展示CPU使用情况
       -d     展示存储设备使用情况
       -h     使输出信息更易看。
       -k     使某些使用block为单位的列强制使用k为单位显示统计信息
       -m     使某些使用block为单位的列强制使用m为单位显示统计信息
       -N     显示任何已注册设备映射器名称, 用于查看LVM2统计
       -n     展示NFS使用情况
       -p &#91; { device &#91;,...] | ALL } ]
              显示设备块及其分区统计信息，可以单独指定特定的设备
       -t     打印显示的每个报表的时间, 时间戳格式可能取决于S_TIME_FORMAT环境变量
       -V     显示iostat版本
       -x     显示扩展统计信息
       -y     如果指定了持续输出，那么忽略默认显示的第一次统计信息，即从系统启动直到执行命令的平均信息。
       -z     省略在采样期间没有活动的任何设备的输出.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

2.执行样例

       iostat
              展示从系统启动到执行命令期间的CPU和存储设备平均统计信息
       iostat -d 2
              以2秒间隔展示存储设备统计信息
       iostat -d 2 6
              以2秒间隔展示存储设备统计信息，共展示6次
       iostat -x hda hdb 2 6
              以2秒间隔展示存储设备hda和hdb的拓展统计信息，共展示6次
       iostat -p sda 2 6
              以2秒间隔展示存储设备sda及其分区的统计信息，共展示6次

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

3.输出信息解析

# iostat -x -d -m -y -c 2 10
Linux 3.10.0-229.el7.x86_64 (KYL-DB-MYSQL-SLAVE01)      05/09/2019      _x86_64_        (24 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.40    0.00    0.38    4.13    0.00   95.10

Device:         rrqm/s   wrqm/s     r/s     w/s    rMB/s    wMB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
sdb               0.00     0.00   14.00  563.00     0.07    19.51    69.49     1.40    2.46    9.89    2.28   0.88  50.90
dm-0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
dm-1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
dm-2              0.00     0.00   13.50  562.50     0.07    19.50    69.58     1.41    2.47   10.26    2.28   0.88  50.95

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

1.CPU信息
%user:用户态CPU使用率
%nice:优先级变化占用CPU的使用率
%system:内核态CPU使用率
%iowait:CPU等待IO的占比
%steal:虚拟CPU等待实际CPU的时间的百分比
%idle:CPU空闲率

2.存储设备信息
rrqm/s:每秒对该设备的读请求的合并次数
wrqm/s:每秒对该设备的写请求的合并次数
r/s:每秒读取的次数
w/s:每秒写入的次数
rMB/s:以m为单位计算每秒读取量
wMB/s:以m为单位计算每秒写入量
avgrq-sz:平均每次IO操作的数据量（扇区数为单位），包括读和写
avgqu-sz:平均等待处理的IO请求队列长度
await:平均IO等待时间（milliseconds），包括排队时间和IO执行时间
r_await:平均读取等待时间（milliseconds），包括排队时间和IO执行时间
w_await:平均写入等待时间（milliseconds），包括排队时间和IO执行时间
svctm:平均IO服务时间（milliseconds），不准确
%util:统计时间内，CPU处理IO的时间对于间隔时间的占比，例如间隔2秒，CPU处理IO占了1秒，那么就是50%，可以体现存储设备的繁忙程度
————————————————
版权声明：本文为CSDN博主「灯火觅阑珊」的原创文章，遵循 CC 4.0 BY-SA 版权协议，转载请附上原文出处链接及本声明。
原文链接：https://blog.csdn.net/weixin_39004901/article/details/90022623</code></pre>



<p>注明：所有转载内容皆直接从被转载文章网页的标题和内容的文本中复制而来</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="1012" height="233" src="https://eternalcenter-2021-12.github.io/wp-content/uploads/2020/03/版权申明证明-iostat.png" alt="" class="wp-image-8556" srcset="https://eternalcenter-2021-12.github.io/wp-content/uploads/2020/03/版权申明证明-iostat.png 1012w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2020/03/版权申明证明-iostat-300x69.png 300w, https://eternalcenter-2021-12.github.io/wp-content/uploads/2020/03/版权申明证明-iostat-768x177.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>CC 4.0 BY-SA 版权协议网址：https://creativecommons.org/licenses/by-sa/4.0/deed.z</figcaption></figure></div>



<p></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
