<?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>Service (服务) &#8211; Eternal Center</title>
	<atom:link href="https://eternalcenter-sep-2022.github.io/category/service/feed/" rel="self" type="application/rss+xml" />
	<link>https://eternalcenter-sep-2022.github.io/</link>
	<description></description>
	<lastBuildDate>Wed, 07 Sep 2022 07:38:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>[内容] /etc/resolv.conf 配置文件的 search 选项</title>
		<link>https://eternalcenter-sep-2022.github.io/etc-resolv-conf-search/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 10 Aug 2022 15:07:19 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Other Service (其它服务)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network (系统网络)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=27527</guid>

					<description><![CDATA[内容一：测试 search 选项的配置 内容二：测试 search 选项 2.1 查询 zhumingyu （补充：当查询 zhumingyu 时，也就是中间没有点 “.”，则默认会被视为查询主机名，会先依次把 eternalcenter.com、local 和 new 作为后缀添加到 zhumingyu 后进行查询，最后才查询 zhumingyu） 2.2 zhumingyu.com （补充：当查询 zhumingyu.com 时，也就是中间有 1 个点 “.”，则默认会被视为查询域名，会先查询 mingyuzhu.com，如果查询失败，则会先依次把 eternalcenter.com、local 和 new 作为后缀添加到 zhumingyu 后进行查询） 2.3 查询 zhumingyu.com. （补充：当查询 zhumingyu.com. 时，也就是末尾有 1 个点 “.”，默认会被视为查询域名，且只会查询这个域名。不会查询 search 里的每 1 项）]]></description>
										<content:encoded><![CDATA[
<h3>内容一：测试 search 选项的配置</h3>



<pre class="wp-block-code"><code># cat /etc/resolv.conf
search eternalcenter.com local new
nameserver 8.8.8.8</code></pre>



<h3>内容二：测试 search 选项</h3>



<h4>2.1 查询 zhumingyu</h4>



<pre class="wp-block-code"><code># host -a zhumingyu
Trying "zhumingyu.eternalcenter.com"
Trying "zhumingyu.local"
Trying "zhumingyu.new"
Trying "zhumingyu"
Host zhumingyu not found: 3(NXDOMAIN)
Received 102 bytes from 8.8.8.8#53 in 62 ms</code></pre>



<p>（补充：当查询 zhumingyu 时，也就是中间没有点 “.”，则默认会被视为查询主机名，会先依次把 eternalcenter.com、local 和 new 作为后缀添加到 zhumingyu 后进行查询，最后才查询 zhumingyu）</p>



<h4>2.2 zhumingyu.com</h4>



<pre class="wp-block-code"><code># host -a zhumingyu.com
Trying "zhumingyu.com"
Received 31 bytes from 1.1.1.1#53 in 217 ms
Trying "zhumingyu.com.eternalcenter.com"
Trying "zhumingyu.com.local"
Trying "zhumingyu.com.new"
Host zhumingyu.com.new not found: 4(NOTIMP)
Received 35 bytes from 1.1.1.1#53 in 218 ms</code></pre>



<p>（补充：当查询 zhumingyu.com 时，也就是中间有 1 个点 “.”，则默认会被视为查询域名，会先查询 mingyuzhu.com，如果查询失败，则会先依次把 eternalcenter.com、local 和 new 作为后缀添加到 zhumingyu 后进行查询）</p>



<h4>2.3 查询 zhumingyu.com.</h4>



<pre class="wp-block-code"><code># host -a zhumingyu.com.
Trying "zhumingyu.com"
Host zhumingyu.com not found: 4(NOTIMP)
Received 31 bytes from 1.1.1.1#53 in 204 ms
Received 31 bytes from 1.1.1.1#53 in 204 ms</code></pre>



<p>（补充：当查询 zhumingyu.com. 时，也就是末尾有 1 个点 “.”，默认会被视为查询域名，且只会查询这个域名。不会查询 search 里的每 1 项）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] SFTP 常用命令</title>
		<link>https://eternalcenter-sep-2022.github.io/sftp-command/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 08 Aug 2022 14:45:03 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[Storage Service (存储服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=27514</guid>

					<description><![CDATA[内容一：SFTP 显示相关 1.1 显示目录或文件 1.1.1 显示远程的目录或文件 1.1.2 显示本地的目录或文件 1.2 显示目录路径 1.2.1 显示远程目录路径 1.2.2 显示本地目录路径 1.3 显示协议版本 1.4 显示帮助信息 内容二：SFTP 目录相关 2.1 创建目录 2.1.1 创建远程目录 2.1.2 创建本地目录 2.2 删除目录 2.2.1 删除远程目录 2.2.2 删除本地目录 2.3 修改目录下 2.3.1 修改目录的所属主 2.3.2 修改目录的所属组 2.3.3 修改目录权限 2.4 进入目录 2.4.1 进入远程目录 2.4.2 进入本地目录 内容三：SFTP 文件相关 3.1 删除文件 3.1.1 删除远程文件 3.1.2 删除本地文件 3.2 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/sftp-command/" class="more-link">Continue reading<span class="screen-reader-text"> "[命令] SFTP 常用命令"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>内容一：SFTP 显示相关</h3>



<h4>1.1 显示目录或文件</h4>



<h5>1.1.1 显示远程的目录或文件</h5>



<pre class="wp-block-code"><code>sftp&gt; ls</code></pre>



<h5>1.1.2 显示本地的目录或文件</h5>



<pre class="wp-block-code"><code>sftp&gt; lls</code></pre>



<h4>1.2 显示目录路径</h4>



<h5>1.2.1 显示远程目录路径</h5>



<pre class="wp-block-code"><code>sftp&gt; pwd</code></pre>



<h5>1.2.2 显示本地目录路径</h5>



<pre class="wp-block-code"><code>sftp&gt; lpwd</code></pre>



<h4>1.3 显示协议版本</h4>



<pre class="wp-block-code"><code>sftp&gt; version</code></pre>



<h4>1.4 显示帮助信息</h4>



<pre class="wp-block-code"><code>sftp&gt; help</code></pre>



<h3>内容二：SFTP 目录相关</h3>



<h4>2.1 创建目录</h4>



<h5>2.1.1 创建远程目录</h5>



<pre class="wp-block-code"><code>sftp&gt; mkdir &lt;directory&gt;</code></pre>



<h5>2.1.2 创建本地目录</h5>



<pre class="wp-block-code"><code>sftp&gt; lmkdir &lt;directory&gt;</code></pre>



<h4>2.2 删除目录</h4>



<h5>2.2.1 删除远程目录</h5>



<pre class="wp-block-code"><code>sftp&gt; rmdir &lt;directory&gt;</code></pre>



<h5>2.2.2 删除本地目录</h5>



<pre class="wp-block-code"><code>sftp&gt; lmkdir &lt;directory&gt;</code></pre>



<h4>2.3 修改目录下</h4>



<h5>2.3.1 修改目录的所属主</h5>



<pre class="wp-block-code"><code>sftp&gt; chown &lt;user&gt; &lt;directory&gt;</code></pre>



<h5>2.3.2 修改目录的所属组</h5>



<pre class="wp-block-code"><code>sftp&gt; chgrp &lt;group&gt; &lt;directory&gt;</code></pre>



<h5>2.3.3 修改目录权限</h5>



<pre class="wp-block-code"><code>sftp&gt; chmod &lt;privilege&gt; &lt;directory&gt;</code></pre>



<h4>2.4 进入目录</h4>



<h5>2.4.1 进入远程目录</h5>



<pre class="wp-block-code"><code>sftp&gt; cd &lt;directory&gt;</code></pre>



<h5>2.4.2 进入本地目录</h5>



<pre class="wp-block-code"><code>sftp&gt; lcd &lt;directory&gt;</code></pre>



<h3>内容三：SFTP 文件相关</h3>



<h4>3.1 删除文件</h4>



<h5>3.1.1 删除远程文件</h5>



<pre class="wp-block-code"><code>sftp&gt; rm &lt;file&gt;</code></pre>



<h5>3.1.2 删除本地文件</h5>



<pre class="wp-block-code"><code>sftp&gt; lrm &lt;file&gt;</code></pre>



<h4>3.2 移动文件</h4>



<p>移动远程文件</p>



<pre class="wp-block-code"><code>sftp&gt; mv &lt;file&gt;</code></pre>



<h3>内容四：上传和下载</h3>



<h5>4.1 从远程下载文件到本地</h5>



<pre class="wp-block-code"><code>sftp&gt; get &lt;file&gt;</code></pre>



<h5>4.2 从本地上传文件到远程</h5>



<pre class="wp-block-code"><code>sftp&gt; put &lt;file&gt;</code></pre>



<h3>内容五：SFTP 管理相关</h3>



<p>退出 SFTP</p>



<pre class="wp-block-code"><code>sftp&gt; exit</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code>sftp&gt; quit</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 dig （从 DNS 服务器获取主机信息）</title>
		<link>https://eternalcenter-sep-2022.github.io/dig/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 29 Jul 2022 08:22:42 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Other Service (其它服务)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network (系统网络)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=27453</guid>

					<description><![CDATA[内容一：dig 命令简介 dig 即 domain information groper，主要功能是从 DNS 服务器获取主机信息 内容二：dig 命令的使用案例 2.1 案例一：显示互联网上所有 DNS 根服务器的信息 2.2 案例二：直接通过域名获取主机信息 （补充：这里以通过 eternalcenter.com 域名获取主机信息为例） 2.3 案例三：直接通过域名获取主机信息，但只显示最基础的内容 （补充：这里以通过 eternalcenter.com 域名获取主机信息为例） 2.4 案例四：直接通过域名获取主机信息，并指定显示的内容 （补充：这里以通过 eternalcenter.com 域名获取主机信息，并显示 noall 和 answer 部分的内容为例） 2.5 案例五：从指定的 DNS 服务器和端口号通过域名获取主机信息 （补充：这里以通过 eternalcenter.com 域名从 IP 地址是 8.8.8.8 端口是 53 的 DNS 服务器获取主机信息为例） 2.6 案例六：通过 IP 地址获取主机信息 （补充：这里以通过 IP &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/dig/" class="more-link">Continue reading<span class="screen-reader-text"> "[命令] Linux 命令 dig （从 DNS 服务器获取主机信息）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>内容一：dig 命令简介</h3>



<p>dig 即 domain information groper，主要功能是从 DNS 服务器获取主机信息</p>



<h3>内容二：dig 命令的使用案例</h3>



<h4>2.1 案例一：显示互联网上所有 DNS 根服务器的信息</h4>



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



<h4>2.2 案例二：直接通过域名获取主机信息</h4>



<pre class="wp-block-code"><code># dig eternalcenter.com</code></pre>



<p>（补充：这里以通过 eternalcenter.com 域名获取主机信息为例）</p>



<h4>2.3 案例三：直接通过域名获取主机信息，但只显示最基础的内容</h4>



<pre class="wp-block-code"><code># dig eternalcenter.com +short</code></pre>



<p>（补充：这里以通过 eternalcenter.com 域名获取主机信息为例）</p>



<h4>2.4 案例四：直接通过域名获取主机信息，并指定显示的内容</h4>



<pre class="wp-block-code"><code># dig eternalcenter.com +noall +answer</code></pre>



<p>（补充：这里以通过 eternalcenter.com 域名获取主机信息，并显示 noall 和 answer 部分的内容为例）</p>



<h4>2.5 案例五：从指定的 DNS 服务器和端口号通过域名获取主机信息</h4>



<pre class="wp-block-code"><code># dig @8.8.8.8 -p 53 eternalcenter.com</code></pre>



<p>（补充：这里以通过 eternalcenter.com 域名从 IP 地址是 8.8.8.8 端口是 53 的 DNS 服务器获取主机信息为例）</p>



<h4>2.6 案例六：通过 IP 地址获取主机信息</h4>



<pre class="wp-block-code"><code># dig -x 8.8.8.8</code></pre>



<p>（补充：这里以通过 IP 地址 8.8.8.8 获取主机信息为例）</p>



<h4>2.7 案例七：通过 IP 地址获得主机信息，但只显示最基础的内容</h4>



<pre class="wp-block-code"><code># dig -x 8.8.8.8  +short</code></pre>



<p>（补充：这里以通过 IP 地址 8.8.8.8 获取主机信息为例）</p>



<h4>2.8 案例八：直接通过域名获取主机信息，同时显示获取的过程</h4>



<pre class="wp-block-code"><code># dig eternalcenter.com +trace</code></pre>



<p>（补充：这里以通过 eternalcenter.com 域名获取主机信息为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[排错] 解决 SFTP 登录时报错 “client_loop: send disconnect: Broken pipe &#8230;&#8230;”</title>
		<link>https://eternalcenter-sep-2022.github.io/debug-client_loop-send-disconnect-broken-pipe/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 27 Jul 2022 15:53:16 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[Storage Service (存储服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=27342</guid>

					<description><![CDATA[报错代码 分析 SFTP 目录的所属主必须是 root，权限最高只能是 755，否则就算此目录的所属主是此 SFTP 用户也会报错 解决方法 步骤一：将 SFTP 目录的所属主设置为 root 步骤二：将 SFTP 目录的权限设置为 755]]></description>
										<content:encoded><![CDATA[
<h2>报错代码</h2>



<pre class="wp-block-code"><code>client_loop: send disconnect: Broken pipe
Connection closed.  
Connection closed</code></pre>



<h2>分析</h2>



<p>SFTP 目录的所属主必须是 root，权限最高只能是 755，否则就算此目录的所属主是此 SFTP 用户也会报错</p>



<h2>解决方法</h2>



<h3>步骤一：将 SFTP 目录的所属主设置为 root</h3>



<pre class="wp-block-code"><code># chown root: &lt;sftp directory&gt;</code></pre>



<h3>步骤二：将 SFTP 目录的权限设置为 755</h3>



<pre class="wp-block-code"><code># chmod 755 &lt;sftp directory&gt;</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] SFTP 的配置案例</title>
		<link>https://eternalcenter-sep-2022.github.io/sftp-configuration-case/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 27 Jul 2022 15:18:27 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[Storage Service (存储服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=27336</guid>

					<description><![CDATA[案例一：将 SFTP 用户的家目录作为 SFTP 用户的 SFTP 目录，让 SFTP 用户通过 SFTP 登录时被限制在自己的家目录里，并使用 2200 端口 将以下内容： 修改为： 并添加以下内容： （补充：这里以将 /etc/ssh/sshd_config 最为 SFTP 的配置文件为例） （注意：SFTP 目录的所属主必须是 root，权限最高只能是 755，否则就算此目录的所属主是此 SFTP 用户也会报错） 案例二：将根目录下以和 SFTP 用户名同名的目录作为此 SFTP 用户的 SFTP 目录，让此 SFTP 用户通过 SFTP 登录时被限制在根目录下以和自己用户名同名的目录里，但是此设置只适用于组是 sftpuser 的用户 将以下内容： 修改为： 并添加以下内容： （补充：这里以将 /etc/ssh/sshd_config 最为 SFTP 的配置文件为例） （注意：SFTP 目录的所属主必须是 root，权限最高只能是 755，否则就算此目录的所属主是此 SFTP 用户也会报错） 案例三：将根目录下以和 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/sftp-configuration-case/" class="more-link">Continue reading<span class="screen-reader-text"> "[内容] SFTP 的配置案例"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>案例一：将 SFTP 用户的家目录作为 SFTP 用户的 SFTP 目录，让 SFTP 用户通过 SFTP 登录时被限制在自己的家目录里，并使用 2200 端口</h3>



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



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



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



<p>修改为：</p>



<pre class="wp-block-code"><code>......
# Subsystem       sftp ......
......</code></pre>



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



<pre class="wp-block-code"><code>......
Subsystem       sftp    internal-sftp
Match LocalPort 2200
  ForceCommand internal-sftp
  PasswordAuthentication yes
  ChrootDirectory %h
  PermitTunnel no
  AllowAgentForwarding no
  AllowTcpForwarding no
  X11Forwarding no</code></pre>



<p>（补充：这里以将 /etc/ssh/sshd_config 最为 SFTP 的配置文件为例）</p>



<p>（注意：SFTP 目录的所属主必须是 root，权限最高只能是 755，否则就算此目录的所属主是此 SFTP 用户也会报错）</p>



<h3>案例二：将根目录下以和 SFTP 用户名同名的目录作为此 SFTP 用户的 SFTP 目录，让此 SFTP 用户通过 SFTP 登录时被限制在根目录下以和自己用户名同名的目录里，但是此设置只适用于组是 sftpuser 的用户</h3>



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



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



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



<p>修改为：</p>



<pre class="wp-block-code"><code>......
# Subsystem       sftp ......
......</code></pre>



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



<pre class="wp-block-code"><code>......
Subsystem       sftp    internal-sftp
Match Group sftpuser
  ForceCommand internal-sftp
  PasswordAuthentication yes
  ChrootDirectory /%u
  PermitTunnel no
  AllowAgentForwarding no
  AllowTcpForwarding no
  X11Forwarding no</code></pre>



<p>（补充：这里以将 /etc/ssh/sshd_config 最为 SFTP 的配置文件为例）</p>



<p>（注意：SFTP 目录的所属主必须是 root，权限最高只能是 755，否则就算此目录的所属主是此 SFTP 用户也会报错）</p>



<h3>案例三：将根目录下以和 SFTP 用户名同名的目录作为此 SFTP 用户的 SFTP 目录，让此 SFTP 用户通过 SFTP 登录时被限制在根目录下以和自己用户名同名的目录里，但是此设置只适用于用户 sftpuser</h3>



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



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



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



<p>修改为：</p>



<pre class="wp-block-code"><code>......
# Subsystem       sftp ......
......</code></pre>



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



<pre class="wp-block-code"><code>......
Subsystem       sftp    internal-sftp
Match User sftpuser
  ForceCommand internal-sftp
  PasswordAuthentication yes
  ChrootDirectory /%u
  PermitTunnel no
  AllowAgentForwarding no
  AllowTcpForwarding no
  X11Forwarding no</code></pre>



<p>（补充：这里以将 /etc/ssh/sshd_config 最为 SFTP 的配置文件为例）</p>



<p>（注意：SFTP 目录的所属主必须是 root，权限最高只能是 755，否则就算此目录的所属主是此 SFTP 用户也会报错）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] audit 的设置 （日志保存时间）</title>
		<link>https://eternalcenter-sep-2022.github.io/audit-log-save-time/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 18 Jul 2022 01:45:08 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[Storage Service (存储服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Privilege Security (系统权限安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26972</guid>

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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



<pre class="wp-block-code"><code># systemctl restart logrotate.service</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[排错] 解决 Red Hat Satellite 发布新版本 Content Views 时报错 “Unable to find content with the ID &#8220;&#8230;&#8230;&#8221;”</title>
		<link>https://eternalcenter-sep-2022.github.io/debug-unable-to-find-content-with-the-id/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 13 Jul 2022 07:10:59 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Other Service (其它服务)]]></category>
		<category><![CDATA[Red Hat Satellite]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26764</guid>

					<description><![CDATA[报错代码 分析 当 Content Views 里包含有问题的软件源时，发布新版本 Content View 时就会报此类错误 解决方法 步骤一：根据报错时出现的 ID 显示出问题的软件名称 （补充：这里以显示 ID 9210 的软件名称为例） 步骤二：给服务器系统打一个快照 （步骤略） 步骤三：强制停止出问题的任务 Monitor &#8211;&#62; Tasks &#8211;&#62; Paused &#8211;&#62; &#8220;select the task which publish a new Content View version&#8221; &#8211;&#62; Cancel (注意：操作前需要确保左上角的组织是否正确) 或者： 步骤三：将出问题的软件源从要布新版本的 Content Views 里删除 Content &#8211;&#62; Content Views &#8211;&#62; &#8220;select the Content View which whill &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/debug-unable-to-find-content-with-the-id/" class="more-link">Continue reading<span class="screen-reader-text"> "[排错] 解决 Red Hat Satellite 发布新版本 Content Views 时报错 “Unable to find content with the ID &#8220;&#8230;&#8230;&#8221;”"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h1>报错代码</h1>



<pre class="wp-block-code"><code>Unable to find content with the ID "......"</code></pre>



<h1>分析</h1>



<p>当 Content Views 里包含有问题的软件源时，发布新版本 Content View 时就会报此类错误</p>



<h1>解决方法</h1>



<h3>步骤一：根据报错时出现的 ID 显示出问题的软件名称</h3>



<pre class="wp-block-code"><code># su - postgres -c "psql candlepin -c \"select uuid, content_id, contentUrl, label, type, vendor from cp2_content where content_id = '9210'\""</code></pre>



<p>（补充：这里以显示 ID 9210 的软件名称为例）</p>



<h3>步骤二：给服务器系统打一个快照</h3>



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



<h3>步骤三：强制停止出问题的任务</h3>



<p>Monitor &#8211;&gt; Tasks &#8211;&gt; Paused &#8211;&gt; &#8220;select the task which publish a new Content View version&#8221; &#8211;&gt; Cancel</p>



<p>(注意：操作前需要确保左上角的组织是否正确)</p>



<p>或者：</p>



<div class="wp-container-1 wp-block-buttons">
<div class="wp-block-button aligncenter is-style-outline"><a class="wp-block-button__link" href="https://eternalcenter-sep-2022.github.io/red-hat-satellite-task-forced-stop/" style="border-radius:0px">Red Hat Satellite 无法停止任务的强制停止</a></div>
</div>



<h3>步骤三：将出问题的软件源从要布新版本的 Content Views 里删除</h3>



<p>Content &#8211;&gt; Content Views &#8211;&gt; &#8220;select the Content View which whill publish a new version&#8221; &#8211;&gt; Yum Content &#8211;&gt; Repository &#8211;&gt; &#8220;select the repository which is error&#8221; &#8211;&gt; Remove Repositories</p>



<h3>步骤四：重新发布新版本的 Content Views</h3>



<p>（步骤略）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] SFTP 日志的开启 （禁止 SFTP 用户 SSH 登录、限制 SFTP 用户可进入的目录范围和端口分离版）</title>
		<link>https://eternalcenter-sep-2022.github.io/sftp-login-no-ssh-login-directory-restriction-port-separation/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 12 Jul 2022 09:36:10 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[Storage Service (存储服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26752</guid>

					<description><![CDATA[注意： 在禁止 SFTP 用户 SSH 登录、限制 SFTP 用户可进入的目录和端口分离的情况下开启 SFTP 日志前，要先设置 SFTP 相应的安全项： 正文： 步骤一：开启 SFTP 日志 1.1 开启 SFTP 的登录日志 1.1.1 修改配置文件 /etc/ssh/sshdsftp_config，开启 sshdsftp 的日志功能 将部分内容修改如下： 1.1.2 让修改的配置生效 1.2 开启 SFTP 的文件日志 1.2.1 修改 /etc/audit/auditd.conf 配置文件，指定 auditd 日志的存放位置 将部分内容修改如下： 1.2.2 修改 /etc/audit/rules.d/audit.rules 配置文件，监控用于 SFTP 服务器的目录以及目录下的目录和文件 添加以下内容： （补充：这里以添加 /sftpuser 目录为例） 1.2.2 让修改的配置生效 步骤二：显示 SFTP 日志 2.1 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/sftp-login-no-ssh-login-directory-restriction-port-separation/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] SFTP 日志的开启 （禁止 SFTP 用户 SSH 登录、限制 SFTP 用户可进入的目录范围和端口分离版）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h1>注意：</h1>



<p>在禁止 SFTP 用户 SSH 登录、限制 SFTP 用户可进入的目录和端口分离的情况下开启 SFTP 日志前，要先设置 SFTP 相应的安全项：</p>



<div class="wp-container-2 wp-block-buttons">
<div class="wp-block-button aligncenter is-style-outline"><a class="wp-block-button__link" href="https://eternalcenter-sep-2022.github.io/sftp-security-no-ssh-login-directory-restriction-port-separation/" style="border-radius:0px">SFTP 安全 <br>（禁止 SFTP 用户 SSH 登录、<br>限制 SFTP 用户可以进入的目录<br>和端口分离版）</a></div>
</div>



<h1>正文：</h1>



<h3>步骤一：开启 SFTP 日志</h3>



<h4>1.1 开启 SFTP 的登录日志</h4>



<h5>1.1.1 修改配置文件 /etc/ssh/sshdsftp_config，开启 sshdsftp 的日志功能</h5>



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



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



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



<h5>1.1.2 让修改的配置生效</h5>



<pre class="wp-block-code"><code># systemctl restart sshdsftp.service</code></pre>



<h4>1.2 开启 SFTP 的文件日志</h4>



<h5>1.2.1 修改 /etc/audit/auditd.conf 配置文件，指定 auditd 日志的存放位置</h5>



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



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



<pre class="wp-block-code"><code>......
log_file = /var/log/audit/audit.log
......</code></pre>



<h5>1.2.2 修改 /etc/audit/rules.d/audit.rules 配置文件，监控用于 SFTP 服务器的目录以及目录下的目录和文件</h5>



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



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



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



<p>（补充：这里以添加 /sftpuser 目录为例）</p>



<h5>1.2.2 让修改的配置生效</h5>



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



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



<h4>2.1 显示 SFTP 的登录日志</h4>



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



<p>（<br>补充：这里会显示<br>1) 用户<br>2) 用户的登录时间<br>3) 用户的退出时间<br>）</p>



<p>（注意：普通用户的登录记录也在里面）</p>



<h4>2.2 显示 SFTP 的文件日志</h4>



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



<p>（<br>补充：这里会显示<br>1) 用户<br>2) 操作的时间<br>2) 被操作的文件<br>3) 被操作的动作 （创建、删除和显示）<br>）</p>



<p>或者：</p>



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



<p>（补充：这里以显示文件被修改的记录为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 pdbedit Samba 用户的管理</title>
		<link>https://eternalcenter-sep-2022.github.io/pdbedit/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 11 Jul 2022 02:59:45 +0000</pubDate>
				<category><![CDATA[Samba]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[Storage Service (存储服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26669</guid>

					<description><![CDATA[内容一：pdbedit 命令的格式 内容二：pdbedit 命令的选项 1) -a 或者 &#8211;create，创建 Samba 用户2) -x 或者 &#8211;delete，删除 Samba 用户3) -r 或者 &#8211;modify，修改 Samba 用户4) -L 或者 &#8211;list，显示所有 Samba 用户5) -Lv 或者 &#8211;list &#8211;verbose，显示所有 Samba 用户的详细信息6) -c “[D]” -u，锁定该 Samba 用户7) -c “[]” -u，解锁该 Samba 用户]]></description>
										<content:encoded><![CDATA[
<h3>内容一：pdbedit 命令的格式</h3>



<pre class="wp-block-code"><code># pdbedit &lt;option&gt; &lt;user&gt;</code></pre>



<h3>内容二：pdbedit 命令的选项</h3>



<p>1) -a 或者 &#8211;create，创建 Samba 用户<br>2) -x 或者 &#8211;delete，删除 Samba 用户<br>3) -r 或者 &#8211;modify，修改 Samba 用户<br>4) -L 或者 &#8211;list，显示所有 Samba 用户<br>5) -Lv 或者 &#8211;list &#8211;verbose，显示所有 Samba 用户的详细信息<br>6) -c “[D]” -u，锁定该 Samba 用户<br>7) -c “[]” -u，解锁该 Samba 用户</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux SSL 证书 KEY 私钥密码的添加 （OpenSSL 版）</title>
		<link>https://eternalcenter-sep-2022.github.io/ssl-password-openssl/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 08 Jul 2022 10:00:50 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Basic Guidelines for Website building (网站建设基础指南)]]></category>
		<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Django Service (服务)]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Nginx Security (安全)]]></category>
		<category><![CDATA[Personal Website Building (个人网站建设)]]></category>
		<category><![CDATA[Project (项目)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Port Security (系统端口安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[Web Application Firewall (WAF)]]></category>
		<category><![CDATA[Website Service (网站服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26489</guid>

					<description><![CDATA[内容一：给 SSL 证书 KEY 私钥添加密码 交互式给 SSL 证书 KEY 私钥添加密码 （补充：这里以给 eternalcenter.com.key） 内容二：取消 SSL 证书 KEY 私钥添加密码 2.1 交互式取消 SSL 证书 KEY 私钥添加密码 2.2 非交互式取消 SSL 证书 KEY 私钥添加密码]]></description>
										<content:encoded><![CDATA[
<h3>内容一：给 SSL 证书 KEY 私钥添加密码</h3>



<p>交互式给 SSL 证书 KEY 私钥添加密码</p>



<pre class="wp-block-code"><code># openssl rsa -des -in eternalcenter.com.key -out one.eternalcenter.com.key</code></pre>



<p>（补充：这里以给 eternalcenter.com.key）</p>



<h3>内容二：取消 SSL 证书 KEY 私钥添加密码</h3>



<h4>2.1 交互式取消 SSL 证书 KEY 私钥添加密码</h4>



<pre class="wp-block-code"><code># openssl rsa -in one.eternalcenter.com.key -out two.eternalcenter.com.key</code></pre>



<h4>2.2 非交互式取消 SSL 证书 KEY 私钥添加密码</h4>



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

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



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



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



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



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



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



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



<p>或者：</p>



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



<p>或者：</p>



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



<p>或者：</p>



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



<p>或者：</p>



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



<p>或者：</p>



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



<p>（补充：这里以使用名为 time_format_conversion.pl 的用于转换 audit 日志时间格式的脚本为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] SUSE Repository Mirroring Tool (RMT) 服务端的设置 （软件源）</title>
		<link>https://eternalcenter-sep-2022.github.io/suse-repository-mirroring-tool-rmt-server-repository-source/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 27 Jun 2022 07:28:40 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Other Service (其它服务)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[SUSE Repository Mirroring Tool (RMT)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26221</guid>

					<description><![CDATA[内容一：显示软件源 1.1 显示所有的 SUSE 软件源产品 1.2 显示所有已经启用的 SUSE 软件源产品 1.3 显示所有指定版本且指定架构的 SUSE 软件源产品 （补充：这里以显示所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品为例） 1.4 显示所有已启用指定版本且指定架构的 SUSE 软件源产品 （补充：这里以显示所有已其应用 15.4 版本且 x86_64 架构的 SUSE 软件源产品为例） 内容二：启用软件源 2.1 启用某个软件源 或者： 2.2 开启所有指定版本且指定架构的 SUSE 软件源产品 （补充：这里以开启所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品） 内容三：取消启用软件源 3.1 取消启用某个软件源 或者： 3.2 取消所有指定版本且指定架构的 SUSE 软件源产品 （补充：这里以取消开启所有 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/suse-repository-mirroring-tool-rmt-server-repository-source/" class="more-link">Continue reading<span class="screen-reader-text"> "[内容] SUSE Repository Mirroring Tool (RMT) 服务端的设置 （软件源）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>内容一：显示软件源</h3>



<h4>1.1 显示所有的 SUSE 软件源产品</h4>



<pre class="wp-block-code"><code># rmt-cli products list --all</code></pre>



<h4>1.2 显示所有已经启用的 SUSE 软件源产品</h4>



<pre class="wp-block-code"><code># rmt-cli products list</code></pre>



<h4>1.3 显示所有指定版本且指定架构的 SUSE 软件源产品</h4>



<pre class="wp-block-code"><code># rmt-cli products list --all --version=15.4 --arch=x86_64</code></pre>



<p>（补充：这里以显示所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品为例）</p>



<h4>1.4 显示所有已启用指定版本且指定架构的 SUSE 软件源产品</h4>



<pre class="wp-block-code"><code># rmt-cli products list --version=15.4 --arch=x86_64</code></pre>



<p>（补充：这里以显示所有已其应用 15.4 版本且 x86_64 架构的 SUSE 软件源产品为例）</p>



<h3>内容二：启用软件源</h3>



<h4>2.1 启用某个软件源</h4>



<pre class="wp-block-code"><code># rmt-cli products enable &lt;id&gt;</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># rmt-cli products enable &lt;string&gt;</code></pre>



<h4>2.2 开启所有指定版本且指定架构的 SUSE 软件源产品</h4>



<pre class="wp-block-code"><code># for i in `rmt-cli products list --all --version=15.4 --arch=x86_64 | awk '{print $2}' | egrep -v '\||ID|^$'`;do rmt-cli products enable $i;done</code></pre>



<p>（补充：这里以开启所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品）</p>



<h3>内容三：取消启用软件源</h3>



<h4>3.1 取消启用某个软件源</h4>



<pre class="wp-block-code"><code># rmt-cli products disable &lt;id&gt;</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># rmt-cli products disable &lt;string&gt;</code></pre>



<h4>3.2 取消所有指定版本且指定架构的 SUSE 软件源产品</h4>



<pre class="wp-block-code"><code># for i in `rmt-cli products list --all --version=15.4 --arch=x86_64 | awk '{print $2}' | egrep -v '\||ID|^$'`;do rmt-cli products disable $i;done</code></pre>



<p>（补充：这里以取消开启所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品）</p>



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



<p class="has-text-align-center">https://documentation.suse.com/sles/15-SP4/single-html/SLES-rmt/index.html#sec-rmt-tools-rmt-cli</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] PXE 装机模板中软件的删除 （openSUSE &#038; SLE 版）</title>
		<link>https://eternalcenter-sep-2022.github.io/pxe-remove-opensuse-sle/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 21 Jun 2022 07:33:42 +0000</pubDate>
				<category><![CDATA[Other Service (其它服务)]]></category>
		<category><![CDATA[Pre-boot Execution Environment (PXE)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=25945</guid>

					<description><![CDATA[（补充：这里以删除 httpd 软件为例）]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code># mv /var/run/zypp.pid /var/run/zypp.sav
# /usr/bin/zypper remove httpd
# mv /var/run/zypp.sav /var/run/zypp.pid</code></pre>



<p>（补充：这里以删除 httpd 软件为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Red Hat Satellite 无法停止任务的强制停止</title>
		<link>https://eternalcenter-sep-2022.github.io/red-hat-satellite-task-forced-stop/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 09 Jun 2022 11:43:29 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Other Service (其它服务)]]></category>
		<category><![CDATA[Red Hat Satellite]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23740</guid>

					<description><![CDATA[步骤一：打一个快照 （步骤略） 步骤二：显示运行结果是错误的任务 （补充：从这里可以看出运行结果是错误的任务标签是 Actions::Katello::ContentView::Publish） 步骤三：强制停止 Red Hat Satellite 无法停止的任务 （补充：这里以强制停止标签为 Actions::Katello::ContentView::Publish 的任务为例）]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：打一个快照</h3>



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



<h3>步骤二：显示运行结果是错误的任务</h3>



<pre class="wp-block-code"><code># sudo su - postgres -c "psql -d foreman -c 'select label,count(label),state,result from foreman_tasks_tasks where state &lt;&gt; '\''stopped'\'' group by label,state,result ORDER BY label;'"
                        label                         | count |   state   | result  
------------------------------------------------------+-------+-----------+---------
 Actions::Katello::ContentView::Publish               |     1 | paused    | error
 ......</code></pre>



<p>（补充：从这里可以看出运行结果是错误的任务标签是 Actions::Katello::ContentView::Publish）</p>



<h3>步骤三：强制停止 Red Hat Satellite 无法停止的任务</h3>



<pre class="wp-block-code"><code># foreman-rake foreman_tasks:cleanup TASK_SEARCH='label = Actions::Katello::ContentView::Publish' STATES='paused' VERBOSE=true</code></pre>



<p>（补充：这里以强制停止标签为 Actions::Katello::ContentView::Publish 的任务为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] NFS 常用参数</title>
		<link>https://eternalcenter-sep-2022.github.io/nfs-parameter/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 27 May 2022 08:11:45 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[Storage Service (存储服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23656</guid>

					<description><![CDATA[内容一：NFS 常用参数 1) no_root_squash 当使用 NFS 共享目录的客户端是以客户端的 root 用户的身份使用，那么对于这个共享目录而言，这个客户端具有 root 权限2) root_squash 当使用 NFS 共享目录的客户端是以客户端的 root 用户的身份使用，那么对于这个共享目录而言，这个客户端依旧没有 root 权限3) 此为默认值，anon=0 禁止使用 NFS 共享目录的客户端以随机身份使用4) anon=1 允许使用 NFS 共享目录的客户端以随机身份使用5) soft 使用 NFS 共享目录的客户端以软挂载的方式进行挂载，若客户端的请求得不到回应，则会重新发出请求并传回错误信息6) 此为默认值，hard 使用 NFS 共享目录的客户端以软挂载的方式进行挂载，若客户端的请求得不到回应，则会一直发出请求直到得到 NFS 服务器的回应为止7) timeo=120 使用 NFS 共享目录的客户端在连接不通后，会以 1/7 秒的时间尝试重新连接，默认会尝试重新连接 7 次，timeo=120 表示会重新尝试连接 120 次8) rw 设置使用 NFS 共享目录的客户端拥有读和写的权限9) nolock 取消文件锁 内容二：NFS &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/nfs-parameter/" class="more-link">Continue reading<span class="screen-reader-text"> "[内容] NFS 常用参数"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>内容一：NFS 常用参数</h3>



<p>1) no_root_squash 当使用 NFS 共享目录的客户端是以客户端的 root 用户的身份使用，那么对于这个共享目录而言，这个客户端具有 root 权限<br>2) root_squash 当使用 NFS 共享目录的客户端是以客户端的 root 用户的身份使用，那么对于这个共享目录而言，这个客户端依旧没有 root 权限<br>3) 此为默认值，anon=0 禁止使用 NFS 共享目录的客户端以随机身份使用<br>4) anon=1 允许使用 NFS 共享目录的客户端以随机身份使用<br>5) soft 使用 NFS 共享目录的客户端以软挂载的方式进行挂载，若客户端的请求得不到回应，则会重新发出请求并传回错误信息<br>6) 此为默认值，hard 使用 NFS 共享目录的客户端以软挂载的方式进行挂载，若客户端的请求得不到回应，则会一直发出请求直到得到 NFS 服务器的回应为止<br>7) timeo=120 使用 NFS 共享目录的客户端在连接不通后，会以 1/7 秒的时间尝试重新连接，默认会尝试重新连接 7 次，timeo=120 表示会重新尝试连接 120 次<br>8) rw 设置使用 NFS 共享目录的客户端拥有读和写的权限<br>9) nolock 取消文件锁</p>



<h3>内容二：NFS 的挂载案例</h3>



<pre class="wp-block-code"><code># cat /etc/fstab
192.168.0.1:/test /test nfs timeo=120,rw,soft,nolock 0 0</code></pre>



<p>（<br>补充：这里以<br>1) 挂载 192.168.0.1:/test 的目录到本地的 /test 目录<br>2) 以 nfs 格式进行挂载<br>3) 客户端在连接不通后会重新尝试连接 120 次<br>4) 客户端拥有读和写的权限<br>5) 以软挂载的方式进行挂载<br>6) 取消文件锁<br>7) 不进行数据备份<br>8) 不进行数据校验<br>为例<br>）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Red Hat Satellite Content View 信息的显示</title>
		<link>https://eternalcenter-sep-2022.github.io/red-hat-satellite-cv-display/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 27 May 2022 06:38:38 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Other Service (其它服务)]]></category>
		<category><![CDATA[Red Hat Satellite]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23638</guid>

					<description><![CDATA[步骤一：显示所有 Content View 的 ID 步骤二：显示某 1 个 Content View 的详细信息 （补充：这里以显示 ID 为 10 的 Content View 的信息为例）]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：显示所有 Content View 的 ID</h3>



<pre class="wp-block-code"><code># hammer content-view list

----------------|---------------------------|--------------------------------------|-----------|---------------------|---------------------------------------------------------------------------------
CONTENT VIEW ID | NAME                      | LABEL                                | COMPOSITE | LAST PUBLISHED      | REPOSITORY IDS                                                                  
----------------|---------------------------|--------------------------------------|-----------|---------------------|---------------------------------------------------------------------------------
10              | test_CV                   | test_CV                              | false     | 2022/06/23 20:20:20 | 61525, 16812, 61524, 16814, 16813, 16811, 16816, 16817, 6578, 231, 8, 9, 131,...</code></pre>



<h3>步骤二：显示某 1 个 Content View 的详细信息</h3>



<pre class="wp-block-code"><code># hammer content-view info --id 10</code></pre>



<p>（补充：这里以显示 ID 为 10 的 Content View 的信息为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] SFTP 安全 （将 SFTP 端口和 SSH 端口分离、限制 SFTP 用户可以进入的目录和禁止 SFTP 用户 SSH 登录版）</title>
		<link>https://eternalcenter-sep-2022.github.io/sftp-security-port-separation-directory-restriction-no-ssh-login/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 23 May 2022 12:35:18 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[Storage Service (存储服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23578</guid>

					<description><![CDATA[步骤一：将 SFTP 端口和 SSH 端口分离 1.1 创建新的 SFTP 配置文件 1.1.1 创建新的 SFTP 配置文件 1.1.2 让新创建的 SFTP 配置文件被 systemctl 管理 1.1.2.1 创建管理 SFTP 配置文件的 systemctl 管理文件 1.1.2.2 修改管理 SFTP 配置文件的 systemctl 管理文件 将以下内容： 修改为： 1.1.2.3 让 systemctl 加载 SFTP 配置文件的 systemctl 管理文件 1.2 将 SFTP 端口和 SSH 端口分离 1.2.1 修改 SFTP 使用的端口 将以下内容： 修改为： 1.2.2 从 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/sftp-security-port-separation-directory-restriction-no-ssh-login/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] SFTP 安全 （将 SFTP 端口和 SSH 端口分离、限制 SFTP 用户可以进入的目录和禁止 SFTP 用户 SSH 登录版）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：将 SFTP 端口和 SSH 端口分离</h3>



<h4>1.1 创建新的 SFTP 配置文件</h4>



<h5>1.1.1 创建新的 SFTP 配置文件</h5>



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



<h5>1.1.2 让新创建的 SFTP 配置文件被 systemctl 管理</h5>



<h5>1.1.2.1 创建管理 SFTP 配置文件的 systemctl 管理文件</h5>



<pre class="wp-block-code"><code># cp /usr/lib/systemd/system/sshd.service /etc/systemd/system/sshdsftp.service</code></pre>



<h5>1.1.2.2 修改管理 SFTP 配置文件的 systemctl 管理文件</h5>



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



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



<pre class="wp-block-code"><code>......
Description=OpenSSH server daemon
......
ExecStart=/usr/sbin/sshd -D $OPTIONS $CRYPTO_POLICY
......</code></pre>



<p>修改为：</p>



<pre class="wp-block-code"><code>......
Description=OpenSSH SFTP server daemon
......
ExecStart=/usr/sbin/sshd -D -f /etc/ssh/sshdsftp_config $OPTIONS $CRYPTO_POLICY
......</code></pre>



<h5>1.1.2.3 让 systemctl 加载 SFTP 配置文件的 systemctl 管理文件</h5>



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



<h4>1.2 将 SFTP 端口和 SSH 端口分离</h4>



<h5>1.2.1 修改 SFTP 使用的端口</h5>



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



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



<pre class="wp-block-code"><code>......
#Port 22
......</code></pre>



<p>修改为：</p>



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



<h5>1.2.2 从 SSH 的配置文件里删除 SFTP 的功能</h5>



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



<p>如果是 CentOS Linux &amp; RHEL，将以下内容：</p>



<pre class="wp-block-code"><code>......
Subsystem  sftp    /usr/libexec/openssh/sftp-server
......</code></pre>



<p>修改为：</p>



<pre class="wp-block-code"><code>......
#Subsystem  sftp    /usr/libexec/openssh/sftp-server
......</code></pre>



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



<pre class="wp-block-code"><code>......
Subsystem       sftp    /usr/lib/ssh/sftp-server
......</code></pre>



<p>修改为：</p>



<pre class="wp-block-code"><code>......
# Subsystem       sftp    /usr/lib/ssh/sftp-server
......</code></pre>



<h5>1.2.3 开放 SFTP 使用的端口</h5>



<h5>1.2.3.1 在防火墙上允许被 SFTP 使用的端口可以被访问</h5>



<h5>1.2.3.1.1 在防火墙上允许被 SFTP 使用的端口可以被访问</h5>



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



<p>（补充：这里以在 firewalld 防火墙开通 2222 端口为例）</p>



<h5>1.2.3.1.2 让新的防火墙策略立刻生效</h5>



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



<h5>1.2.3.2 在 SELinux 上给 SFTP 使用的端口打上 SSH 标签</h5>



<pre class="wp-block-code"><code># semanage port -a -t ssh_port_t -p tcp 2222</code></pre>



<p>（补充：这里以给 2222 端口打上 SSH 的标签为例）</p>



<p>（注意：此步骤只有在 SELinux 开启，且处于 enforcing 状态时才需要设置）</p>



<h4>1.3 让 SFTP 端口和 SSH 端口分离的设置生效</h4>



<h5>1.3.1 开启 SFTP 并将 SFTP 设置为开机自启</h5>



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



<h5>1.3.2 重启 SSHD</h5>



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



<h3> 步骤二：限制 SFTP 用户可以进入的目录</h3>



<h4>2.1 限制 SFTP 用户可以进入的目录</h4>



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



<p>如果是 CentOS Linux &amp; RHEL，将以下内容：</p>



<pre class="wp-block-code"><code>......
Subsystem  sftp    /usr/libexec/openssh/sftp-server
......</code></pre>



<p>修改为：</p>



<pre class="wp-block-code"><code>......
#Subsystem  sftp    /usr/libexec/openssh/sftp-server
......</code></pre>



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



<pre class="wp-block-code"><code>......
Subsystem       sftp    /usr/lib/ssh/sftp-server
......</code></pre>



<p>修改为：</p>



<pre class="wp-block-code"><code>......
# Subsystem       sftp    /usr/lib/ssh/sftp-server
......</code></pre>



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



<pre class="wp-block-code"><code>......
Subsystem       sftp    internal-sftp
Match LocalPort 2222
ChrootDirectory /%u
ForceCommand    internal-sftp
AllowTcpForwarding no
X11Forwarding no</code></pre>



<p>（<br>补充：<br>1) 这里以将 SFTP 的端口设置为 2222 和 SFTP 用户可以进入的目录只能为 /&lt;user&gt; 为例<br>2) 其它配置方案可以参考<br></p>



<div class="wp-container-3 wp-block-buttons">
<div class="wp-block-button aligncenter is-style-outline"><a class="wp-block-button__link" href="https://eternalcenter-sep-2022.github.io/sftp-configuration-case/" style="border-radius:0px">SFTP 的配置案例</a></div>
</div>



<p>）</p>



<h4>2.2 让限制 SFTP 用户可以进入的目录的设置生效</h4>



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



<h3>步骤三：禁止 SFTP 用户 SSH 登录</h3>



<h4>3.1 创建 SFTP 用户</h4>



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



<p>（补充：这里以创建名为 sftpuser 的用户为例）</p>



<h4>3.2 禁止 SFTP 用户 SSH 登录</h4>



<pre class="wp-block-code"><code># usermod -s /bin/false sftpuser</code></pre>



<p>（补充：这里以将用户 sftpuser 的解释器修改成 /bin/false 为例）</p>



<p>或者：</p>



<pre class="wp-block-code"><code># usermod -s /sbin/nologin sftpuser</code></pre>



<p>（补充：这里以将用户 sftpuser 的解释器修改成 /sbin/nologin 为例）</p>



<h4>3.3 给 SFTP 用户设置密码</h4>



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



<p>（补充：这里以给 sftp 用户设置密码为例）</p>



<h4>3.4 创建 SFTP 用户的 SFTP 目录</h4>



<h5>3.4.1 创建 SFTP 用户的 SFTP 目录</h5>



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



<p>（补充：这里以创建 /sftp 目录为例）</p>



<h5>3.4.2 设置此 SFTP 目录的所属主</h5>



<pre class="wp-block-code"><code># chown root: /sftpuser</code></pre>



<p>（补充：这里以设置 /sftp 目录的所属主为 root 为例）</p>



<p>（注意：SFTP 目录的所属主必须是 root，权限最高只能是 755，否则就算此目录的所属主是此 SFTP 用户也会报错）</p>



<h5>3.4.3 设置此 SFTP 目录的权限</h5>



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



<p>（补充：这里以给 /sftp 目录设置 755 权限为例）</p>



<p>（注意：SFTP 目录的所属主必须是 root，权限最高只能是 755，否则就算此目录的所属主是此 SFTP 用户也会报错）</p>



<h3>步骤四：测试 SFTP</h3>



<h4>4.1 创建测试用户</h4>



<h5>4.1.1 创建测试用户</h5>



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



<p>（补充：这里以创建测试用户 nosftp 为例）</p>



<h5>4.1.2 给测试用户设置密码</h5>



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



<h4>4.2 测试 SFTP 用户无法 SSH</h4>



<pre class="wp-block-code"><code># ssh sftpuser@127.0.0.1</code></pre>



<p>（补充：这里以测试用户是 sftp 为例）</p>



<h4>4.3 测试 SFTP 目录范围</h4>



<h5>4.3.1 登录 SFTP</h5>



<pre class="wp-block-code"><code># sftp -P 2222 sftpuser@127.0.0.1
Connected to sftpuser@127.0.0.1.
sftp&gt;</code></pre>



<p>（补充：这里以 SFTP 端口是 2222，SFTP 目录时 /sftpuser ，测试用户是 sftpuser 为例）</p>



<h5>4.3.2 确认 SFTP 根目录</h5>



<h5>4.3.2.1 切换到 SFTP 的根目录</h5>



<pre class="wp-block-code"><code>sftp&gt; cd /</code></pre>



<h5>4.3.2.2 显示 SFTP 根目录下的文件或目录</h5>



<pre class="wp-block-code"><code>sftp&gt; ls
write  
sftp&gt;</code></pre>



<p>（补充：此时发现目前 SFTP 的根并不是 Linux 系统的根目录）</p>



<h4>4.4 测试 SSH 和 SFTP 分离</h4>



<h5>4.4.1 SSH 测试</h5>



<h5>4.4.1.1 SSH 端口可以正常 SSH</h5>



<pre class="wp-block-code"><code># ssh nosftp@127.0.0.1</code></pre>



<p>（补充：这里以 SSH 端口是 22，测试用户是 nosftp 为例）</p>



<h5>4.4.1.2 SFTP 端口不能被 SSH</h5>



<h5>4.4.1.2.1 有 SFTP 目录的用户不能通过 SFTP 端口 SSH</h5>



<pre class="wp-block-code"><code># ssh -p 2222 sftpuser@127.0.0.1
nosftpuser@192.168.8.58's password: 
This service allows sftp connections only.
Connection to 10.0.0.3 closed.
#</code></pre>



<p>（补充：这里以 SFTP 端口是 2222，SFTP 目录是 /sftpuser，测试用户是 sftpuser 为例）</p>



<h5>4.4.1.2.2 没有 SFTP 目录的用户不能通过 SFTP 端口 SSH</h5>



<pre class="wp-block-code"><code># ssh -p 2222 nosftp@127.0.0.1
client_loop: send disconnect: Broken pipe
#</code></pre>



<p>（补充：这里以 SFTP 端口是 2222，SFTP 目录是 /sftp，测试用户是 nosftp 为例）</p>



<h5>4.4.2 SFTP 测试</h5>



<h5>4.4.2.1 SSH 端口不能 SFTP</h5>



<pre class="wp-block-code"><code># sftp sftpuser@127.0.0.1
subsystem request failed on channel 0
Connection closed
#</code></pre>



<p>（补充：这里以 SFTP 端口是 22，测试用户是 sftpuser 为例）</p>



<h5>4.4.2.2 没有 SFTP 目录的用户不能通过 SFTP 端口 SFTP</h5>



<pre class="wp-block-code"><code># sftp -P 2222 nosftp@127.0.0.1
client_loop: send disconnect: Broken pipe
Connection closed
#</code></pre>



<p>（补充：这里以 SFTP 端口是 2222，SFTP 目录是 /sftp，测试用户是 nosftp 为例）</p>



<h5>4.4.2.3 有 SFTP 目录的用户可以通过 SFTP 端口 SFTP</h5>



<pre class="wp-block-code"><code># sftp -P 2222 sftpuser@127.0.0.1
Connected to sftpuser@127.0.0.1.
sftp&gt;</code></pre>



<p>（补充：这里以 SFTP 端口是 2222，SFTP 目录是 /sftpuser ，测试用户是 sftpuser 为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 测试 SFTP 服务</title>
		<link>https://eternalcenter-sep-2022.github.io/shell-sftp-test/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 14 May 2022 14:11:28 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Language (语言)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tools (工具)]]></category>
		<category><![CDATA[Storage Service (存储服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23553</guid>

					<description><![CDATA[介绍 基本信息 作者：朱明宇名称：测试 SFTP 服务作用：测试 SFTP 服务 使用方法 1. 在此脚本的分割线内写入相应的内容2. 给此脚本添加执行权限3. 执行此脚本 脚本分割线里的变量 IP=10.0.0.8 #要测试 SFTP 的服务器 IP 地址 注意 此脚本执行前必须要先保证执行脚本的主机能无秘钥远程需要测试 SFTP 服务的服务器 脚本]]></description>
										<content:encoded><![CDATA[
<h2>介绍</h2>



<h3>基本信息</h3>



<p>作者：朱明宇<br>名称：测试 SFTP 服务<br>作用：测试 SFTP 服务</p>



<h3>使用方法</h3>



<p>1. 在此脚本的分割线内写入相应的内容<br>2. 给此脚本添加执行权限<br>3. 执行此脚本</p>



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



<p>IP=10.0.0.8 #要测试 SFTP 的服务器 IP 地址 </p>



<h3>注意</h3>



<p>此脚本执行前必须要先保证执行脚本的主机能无秘钥远程需要测试 SFTP 服务的服务器</p>



<h2>脚本</h2>



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

####################### Separator ########################
IP=10.0.0.8
####################### Separator ########################

set timeout 3

rpm -q expect &amp;&gt; /dev/null
if &#91; $? -ne 0 ];then
        echo "Expect needs to be installed first"
fi

expect &lt;&lt; EOF
spawn sftp $IP
expect "sftp&gt;"                                   {send "cd /tmp\r" } 
expect "sftp&gt;"                                   {send "ls -l\r"}
expect "sftp&gt;"                                   {send "quit\r"}
expect "&gt;"                                       {send "\r"}
EOF</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] SUSE Repository Mirroring Tool (RMT) 服务端的设置 （网络代理）</title>
		<link>https://eternalcenter-sep-2022.github.io/rmt-proxy/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 28 Apr 2022 11:26:11 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Other Service (其它服务)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[SUSE Repository Mirroring Tool (RMT)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23351</guid>

					<description><![CDATA[将部分内容修改如下： （补充：这里以将网络代理网址设置为 https://eternalcenter-sep-2022.github.io，网络代理端口设置为/ 8000，不使用密码为例）]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code># vim /etc/rmt.conf</code></pre>



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



<pre class="wp-block-code"><code>http_client:
  verbose: false
  proxy: https://eternalcenter-sep-2022.github.io:8000/
  proxy_auth: 
  proxy_user: 
  proxy_password: </code></pre>



<p>（补充：这里以将网络代理网址设置为 https://eternalcenter-sep-2022.github.io，网络代理端口设置为/ 8000，不使用密码为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Red Hat Satellite 打补丁或升级</title>
		<link>https://eternalcenter-sep-2022.github.io/red-hat-satellite-patch-upgrade/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 25 Apr 2022 09:01:00 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Other Service (其它服务)]]></category>
		<category><![CDATA[Red Hat Satellite]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23278</guid>

					<description><![CDATA[步骤一：备份系统 1.1 关闭 Red Hat Satellite 服务 1.2 备份系统 （补充：这里以备份虚拟环境下的 Red Hat Satellite 为例） 1.2.1 关闭系统 1.2.2 给系统打快照 （步骤略） 1.2.3 启动系统 （步骤略） 步骤二：升级 Red Hat Satellite 或给 Red Hat Satellite 打补丁 2.1 检测可升级 RedHat Satellite 版本 2.2 预检测升级 Red Hat Satellite 或给 Red Hat Satellite 打补丁是否能成功 （注意：如果是升级 Red Hat Satellite 的话就指定最新的版本，如果是给 Red Hat Satellite 打补丁的话就选择当前的版本） &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/red-hat-satellite-patch-upgrade/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] Red Hat Satellite 打补丁或升级"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：备份系统</h3>



<h4>1.1 关闭 Red Hat Satellite 服务</h4>



<pre class="wp-block-code"><code># satellite-maintain service stop</code></pre>



<h4>1.2 备份系统</h4>



<p>（补充：这里以备份虚拟环境下的 Red Hat Satellite 为例）</p>



<h5>1.2.1 关闭系统</h5>



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



<h5>1.2.2 给系统打快照</h5>



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



<h5>1.2.3 启动系统</h5>



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



<h3>步骤二：升级 Red Hat Satellite 或给 Red Hat Satellite 打补丁</h3>



<h4>2.1 检测可升级 RedHat Satellite 版本</h4>



<pre class="wp-block-code"><code># satellite-maintain upgrade list-versions</code></pre>



<h4>2.2 预检测升级 Red Hat Satellite 或给 Red Hat Satellite 打补丁是否能成功</h4>



<pre class="wp-block-code"><code># satellite-maintain upgrade check --target-version 6.10.z</code></pre>



<p>（注意：如果是升级 Red Hat Satellite 的话就指定最新的版本，如果是给 Red Hat Satellite 打补丁的话就选择当前的版本）</p>



<p>（补充：这里以指定 6.10.z 版本的 Red Hat Satellite 为例）</p>



<h4>2.3 升级 Red Hat Satellite 或给 Red Hat Satellite 打补丁</h4>



<pre class="wp-block-code"><code># satellite-maintain upgrade run --target-version 6.10.z</code></pre>



<p>（<br>注意：<br>1) 只有当预检测升级 Red Hat Satellite 或给 Red Hat Satellite 打补丁成功后才能接着执行此步骤<br>2) 如果是升级 Red Hat Satellite 的话就指定最新的版本，如果是给 Red Hat Satellite 打补丁的话就选择当前的版本<br>）</p>



<p>（补充：这里以指定 6.10.z 版本的 Red Hat Satellite 为例）</p>



<h3>步骤三：重启 Red Hat Satellite</h3>



<h4>3.1 关闭 Red Hat Satellite 服务</h4>



<pre class="wp-block-code"><code># satellite-maintain service stop</code></pre>



<h4>3.2 重启 Red Hat Satellite</h4>



<pre class="wp-block-code"><code># reboot</code></pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
