<?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>Centos &#8211; 科技改变生活-雨落星辰</title>
	<atom:link href="https://p1e.cn/html/tag/centos/feed" rel="self" type="application/rss+xml" />
	<link>https://p1e.cn</link>
	<description>所有的伟大,都源于一个勇敢的开始</description>
	<lastBuildDate>Sat, 04 Feb 2023 10:05:58 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>CentOS安装Apache Bench进行网站压力测试</title>
		<link>https://p1e.cn/html/3276.html</link>
					<comments>https://p1e.cn/html/3276.html#respond</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Sun, 29 Jan 2023 04:05:00 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[Apache Bench]]></category>
		<category><![CDATA[Centos]]></category>
		<guid isPermaLink="false">https://www.815494.com/?p=3276</guid>

					<description><![CDATA[ApacheBench （简称ab）是一个指令列程式，可用于网站压力测试。如果已经安装过Apache，会自带ab工具，如果不想安装Apache，又想使用ab命令的可通过下面的方法单独安装ApacheBench 安装 #安装相关依赖 yum -y install apr-util yum -y install yum-utils #创建临时目录 mkdir abtmp &#38;&#38; cd abtmp #安装 yumdownloader httpd-tools* rpm2cpio httpd-tools-*.r]]></description>
										<content:encoded><![CDATA[<p>ApacheBench （简称ab）是一个指令列程式，可用于网站压力测试。如果已经安装过Apache，会自带ab工具，如果不想安装Apache，又想使用ab命令的可通过下面的方法单独安装ApacheBench</p>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-3277" src="https://i.p1e.cn/2023/01/blog20230129120323pEAajY.jpg" width="500" height="203" /></p>
<h3>安装</h3>
<pre><code class="bash hljs"><span class="hljs-comment">#安装相关依赖</span>
yum -y install apr-util
yum -y install yum-utils
<span class="hljs-comment">#创建临时目录</span>
mkdir abtmp &amp;&amp; <span class="hljs-built_in">cd</span> abtmp
<span class="hljs-comment">#安装</span>
yumdownloader httpd-tools*
rpm2cpio httpd-tools-*.rpm |cpio -idmv
<span class="hljs-comment">#拷贝</span>
cp usr/bin/ab /usr/bin
</code></pre>
<p>输入上面的命令，一行一个，不出意外的情况下输入<code>ab -V</code>就能查看到相关信息了，如下截图。</p>
<p><img decoding="async" class="alignnone size-full wp-image-3278" src="https://i.p1e.cn/2023/01/blog20230129120326auf742.png" width="526" height="69" /></p>
<h3>网站压力测试</h3>
<p>输入命令<code>ab -n 1000 -c 50 https://www.baidu.com/</code>进行测试，这句话的意思是对www.baidu.com发起1000个请求，并发数为50，常用的参数基本就下面两个：</p>
<ul>
<li>-n：指定测试会话使用的请求数；</li>
<li>-c：指定一次向服务器发出请求数；</li>
</ul>
<p>如果需要查看更多的参数说明，请访问：<a title="ab命令" href="http://man.linuxde.net/ab" target="_blank" rel="nofollow noopener">ab命令</a><br />
通过日志分析，发现刚刚ab命令发送了大量请求过来，如下截图，相当于网站正在遭受小规模的CC攻击。</p>
<p><img decoding="async" class="alignnone size-full wp-image-3279" src="https://i.p1e.cn/2023/01/blog20230129120328KAtAf7.png" width="584" height="457" /></p>
<h3>总结</h3>
<p>ApacheBench可用户网站压力测试，亦可用于发起CC攻击，请不要滥用哦。</p>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/3276.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>No package XXX available 解决方法</title>
		<link>https://p1e.cn/html/2924.html</link>
					<comments>https://p1e.cn/html/2924.html#respond</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Wed, 14 Apr 2021 01:01:32 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[Centos]]></category>
		<guid isPermaLink="false">https://www.815494.com/?p=2924</guid>

					<description><![CDATA[出现这种问题的原因是要安装的软件包默认不在centos的光盘yum仓库中，因此我们需要配置 epel仓库 1、配置阿里云网络源 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 2、配置epel源 yum install -y epel-release 注：Centos-7.repo提供了centos7官方发行版提供的软件包，epel源提供除了官方发行版以外的额外的软件包，适用于RHEL、Ce]]></description>
										<content:encoded><![CDATA[<p>出现这种问题的原因是要安装的软件包默认不在centos的光盘yum仓库中，因此我们需要配置 epel仓库</p>
<p>1、配置阿里云网络源</p>
<pre>wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo</pre>
<p>2、配置epel源</p>
<pre>yum install -y epel-release</pre>
<p>注：Centos-7.repo提供了centos7官方发行版提供的软件包，epel源提供除了官方发行版以外的额外的软件包，适用于RHEL、CentOS和Scientific Linux。</p>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/2924.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>VirtualBox安装CentOS7</title>
		<link>https://p1e.cn/html/2898.html</link>
					<comments>https://p1e.cn/html/2898.html#respond</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Mon, 12 Apr 2021 05:20:53 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<guid isPermaLink="false">https://www.815494.com/?p=2898</guid>

					<description><![CDATA[一：、下载CentOS7的镜像 下载地址：https://www.centos.org/download/ 进入后有三个版本可以选择： 1、DVD ISO  标准安装版，一般下载这个就可以了（推荐）本文以此为例！ 2、Everything ISO 对完整版安装盘的软件进行补充，集成所有软件！ 3、Minimal ISO 一个非常基本的CentOS 系统，只需要最少的软件包即可拥有一个功能系统（软件比较少，大部分需要自己去装） 我下载的是：CentOS-7-x86_64-DVD-1804.iso 二：、创建虚拟机 2]]></description>
										<content:encoded><![CDATA[<p><strong>一：、下载CentOS7的镜像</strong></p>
<p>下载地址：<a href="https://www.centos.org/download/" target="_blank" rel="noopener">https://www.centos.org/download/</a></p>
<p>进入后有三个版本可以选择：</p>
<p>1、DVD ISO  标准安装版，一般下载这个就可以了（推荐）本文以此为例！</p>
<p>2、Everything ISO 对完整版安装盘的软件进行补充，集成所有软件！</p>
<p>3、<span id="result_box" lang="zh-CN"><span title="CentOS-6.3-x86_64-minimal.iso   ">Minimal ISO <span title="The aim of this image is to install a very basic CentOS 6.3 system, with the minimum of packages needed to have a functional system.   ">一个非常基本的CentOS 系统，只需要最少的软件包即可拥有一个功能系统（软件比较少，大部分需要自己去装）</span></span></span></p>
<p><span lang="zh-CN"><span title="CentOS-6.3-x86_64-minimal.iso   "><span title="The aim of this image is to install a very basic CentOS 6.3 system, with the minimum of packages needed to have a functional system.   ">我下载的是：CentOS-7-x86_64-DVD-1804.iso</span></span></span></p>
<p><strong><span lang="zh-CN"><span title="CentOS-6.3-x86_64-minimal.iso   "><span title="The aim of this image is to install a very basic CentOS 6.3 system, with the minimum of packages needed to have a functional system.   ">二：、创建虚拟机</span></span></span></strong></p>
<p><strong><span lang="zh-CN"><span title="CentOS-6.3-x86_64-minimal.iso   "><span title="The aim of this image is to install a very basic CentOS 6.3 system, with the minimum of packages needed to have a functional system.   ">2.1、选择linux版本</span></span></span></strong></p>
<p><span lang="zh-CN"><span title="CentOS-6.3-x86_64-minimal.iso   "><span title="The aim of this image is to install a very basic CentOS 6.3 system, with the minimum of packages needed to have a functional system.   "><img loading="lazy" decoding="async" class="medium-zoom-image alignnone wp-image-2899 size-medium" src="https://i.p1e.cn/2021/04/y1AG4L-800x416.png" alt="" width="800" height="416" /></span></span></span></p>
<p><strong><em>注意：如果选择版本的时候发现没有64 bit选项，说明你的电脑没有开启CPU虚拟化</em></strong></p>
<p><strong> 双击运行“securable”程序（百度搜索securable 下载），在打开的程序主界面中就可以查看CPU是否支持虚拟化功能，如图所示，出现“YES”绿色标记，就表明CPU具有虚拟化功能。</strong></p>
<div class="content-list-text"> <img loading="lazy" decoding="async" class="content-list-text alignnone size-full wp-image-2900" src="https://i.p1e.cn/2021/04/sXHMGu.png" width="453" height="345" /></div>
<div class="content-list-media">开启虚拟化共功能方法：开机&#8211;》BIOS&#8211;》<strong>Configuration&#8211;》</strong><strong>Intel Virtualization Technology &#8211;enable 回车</strong></div>
<p>下一步。</p>
<p><strong>2.2、分配内存</strong></p>
<p><img loading="lazy" decoding="async" class="content-list-media alignnone size-full wp-image-2901" src="https://i.p1e.cn/2021/04/maJM7N.png" width="438" height="364" /></p>
<p>&nbsp;</p>
<p>使用建议的内存大小即可，根据宿主机的配置可以自己进行调整，这里的值可以理解为虚拟机最大可占用宿主机的多少内存</p>
<p><strong>2.3、点击下一步设置虚拟硬盘</strong></p>
<p><img loading="lazy" decoding="async" class="content-list-media alignnone size-full wp-image-2902" src="https://i.p1e.cn/2021/04/am7P4X.png" width="440" height="371" /></p>
<p>这里有三个选项，可以选择使用已有的虚拟硬盘文件，或者先不添加虚拟硬盘，等创建好虚拟机后再添加，这里我们选择第二个现在创建虚拟硬盘</p>
<p><strong>2.4、点击创建，进入虚拟硬盘文件类型选项</strong></p>
<p><img loading="lazy" decoding="async" class="content-list-media alignnone size-full wp-image-2903" src="https://i.p1e.cn/2021/04/YQlQHX.png" width="467" height="417" /></p>
<p>一般选第一个 那两个没有用过，不过也可以尝试下。</p>
<p><strong>2.5、点击下一步，进行设置如何分配虚拟硬盘</strong></p>
<p><img loading="lazy" decoding="async" class="content-list-media alignnone size-full wp-image-2904" src="https://i.p1e.cn/2021/04/z3Gvp3.png" width="467" height="417" /></p>
<p>默认即可</p>
<p><strong>2.6、点击下一步，指定虚拟硬盘文件的存放位置和虚拟硬盘的大小。</strong></p>
<p><img loading="lazy" decoding="async" class="content-list-media alignnone size-full wp-image-2905" src="https://i.p1e.cn/2021/04/rEj8e5.png" width="467" height="417" /></p>
<p>位置最好选择空间大的磁盘，不要放C盘哦，大小就是推荐的8G</p>
<p><strong>2.7、点击创建，代表创建完成</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone wp-image-2906 size-medium" src="https://i.p1e.cn/2021/04/JG3IHJ-800x416.png" alt="" width="800" height="416" /></p>
<p><strong>三、安装虚拟环境</strong></p>
<p>右键点击&#8211;》设置</p>
<p><strong> 3.1、选择网卡</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone size-full wp-image-2907" src="https://i.p1e.cn/2021/04/H7zEb1.png" width="725" height="439" /></p>
<p>设置网络选择桥接网卡，</p>
<p><strong>3.2、设置镜像文件</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone size-full wp-image-2908" src="https://i.p1e.cn/2021/04/tNAJOL.png" width="725" height="439" /></p>
<p>点击OK。</p>
<p><strong>3.3、启动虚拟机。</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone size-full wp-image-2909" src="https://i.p1e.cn/2021/04/hZOzWq.png" width="657" height="543" /></p>
<p>第一个选项是安装CentOS7，第二个选项是检查操作系统文件是否损坏并安装CentOS7</p>
<p><strong> 3.4、选择第一个安装CentOS7,进入语言选择</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone wp-image-2910 size-medium" src="https://i.p1e.cn/2021/04/oHgtQu-800x654.png" alt="" width="800" height="654" /></p>
<p>一直拉到最下面，当然选择中文&#8211;简体中文</p>
<p><strong>3.5、点击继续，</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone wp-image-2911 size-medium" src="https://i.p1e.cn/2021/04/UXvlEY-800x635.png" alt="" width="800" height="635" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>提示先完成带有黄色叹号的内容，否则无法进行下一步，我们看到安装位置处于此状态，并显示已选择自动分区</p>
<p><strong>3.6、黄色叹号只是警告我们默认使用了自动分区，目的是让我们确认一下，是否需要手动分区，我们点进去</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone wp-image-2912 size-medium" src="https://i.p1e.cn/2021/04/Cw741M-800x650.png" alt="" width="800" height="650" /></p>
<p>如果不需要手动分区，还使用默认的自动分区进行安装的话，我们直接点击左上角的完成退出</p>
<p><strong>3.7、退出后回到刚刚那个摘要的界面，发现黄色感叹号不见了</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone wp-image-2913 size-medium" src="https://i.p1e.cn/2021/04/pyh287-800x654.png" alt="" width="800" height="654" /></p>
<p>右下角可以开始安装了，不过安装之前我们需要把以太网打开，否则系统安装后无法联网，并且在命令行操作系统内开启网络需要修改配置相对麻烦。</p>
<p><strong>3.8、摘要的界面上可以看到网络和主机名的显示为未链接，我们点进去</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone wp-image-2914 size-medium" src="https://i.p1e.cn/2021/04/w1e5hX-800x654.png" alt="" width="800" height="654" /></p>
<p>点击打开以太网，点击完成退出</p>
<p><strong>3.9、此时的网络和主机名显示有线已连接</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone wp-image-2915 size-medium" src="https://i.p1e.cn/2021/04/msYxjY-800x654.png" alt="" width="800" height="654" /></p>
<p><strong>3.11、如果需要图形界面，可以点击软件选择，选择基本环境(如果需要图形界面请下载完整版的操作系统iso镜像文件)</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone wp-image-2916 size-medium" src="https://i.p1e.cn/2021/04/Ch6U3h-800x581.png" alt="" width="800" height="581" /></p>
<p>这里选择最小安装即可，linux作为服务器时一般不需要图形界面(图形界面会消耗掉一定的硬件性能)，有一个终端仿真器，然后能够通过shell命令去操作系统就足够了。</p>
<p><strong>3.12、设置root密码</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone wp-image-2917 size-medium" src="https://i.p1e.cn/2021/04/9Q38Ay-800x654.png" alt="" width="800" height="654" /></p>
<p>点击root密码,</p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone wp-image-2918 size-medium" src="https://i.p1e.cn/2021/04/dmh256-800x654.png" alt="" width="800" height="654" /></p>
<p><strong>3.13、点击完成两次，所有黄色感叹号消失</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone wp-image-2919 size-medium" src="https://i.p1e.cn/2021/04/EJ8aNW-800x654.png" alt="" width="800" height="654" /></p>
<p>&nbsp;</p>
<p>点击完成配置。开启默默等待</p>
<p><strong>3.14、完成后点击重启</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone wp-image-2920 size-medium" src="https://i.p1e.cn/2021/04/GB9Fxy-800x654.png" alt="" width="800" height="654" /></p>
<p><strong>3.15、输入用户名密码登录</strong></p>
<p><img loading="lazy" decoding="async" class="medium-zoom-image alignnone size-full wp-image-2921" src="https://i.p1e.cn/2021/04/gmmZEM.png" width="731" height="470" /></p>
<p>至此CentOS7安装完成</p>
<p>&nbsp;</p>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/2898.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>执行yum提示错误：rpmdb: BDB0113 Thread/process 424227/139826856310848 failed</title>
		<link>https://p1e.cn/html/2826.html</link>
					<comments>https://p1e.cn/html/2826.html#respond</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Thu, 25 Mar 2021 06:34:32 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[yum]]></category>
		<guid isPermaLink="false">https://www.815494.com/?p=2826</guid>

					<description><![CDATA[在执行yum安装或者其他命令时，有如下提示： 【解决办法：重新构建rpm数据库】]]></description>
										<content:encoded><![CDATA[<p>在执行yum安装或者其他命令时，有如下提示：<br />
<img decoding="async" src="https://i.p1e.cn/2021/03/1L3Hpj.png" alt="rpmdb: BDB011" /></p>
<p>【解决办法：重新构建rpm数据库】</p>
<pre>[root@cly ~]# cd /var/lib/rpm</pre>
<pre>[root@cly rpm]# rm -rf __db*</pre>
<pre>[root@cly rpm]# rpm --rebuilddb</pre>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/2826.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>firewalld的基本使用</title>
		<link>https://p1e.cn/html/2686.html</link>
					<comments>https://p1e.cn/html/2686.html#respond</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Tue, 02 Mar 2021 11:15:27 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[firewalld]]></category>
		<guid isPermaLink="false">https://www.815494.com/?p=2686</guid>

					<description><![CDATA[1、firewalld的基本使用 启动：  systemctl start firewalld 查看状态：  systemctl status firewalld 停止：  systemctl disable firewalld 禁用：  systemctl stop firewalld &#160; 2.systemctl是CentOS7的服务管理工具中主要的工具，它融合之前service和chkconfig的功能于一体。 启动一个服务： systemctl start firewalld.service 关闭一]]></description>
										<content:encoded><![CDATA[<h1 id="hid-5EJD22">1、firewalld的基本使用</h1>
<p><strong>启动</strong>： </p>
<pre>systemctl start firewalld</pre>
<p><strong>查看状态</strong>： </p>
<pre>systemctl status firewalld</pre>
<p><strong>停止</strong>： </p>
<pre>systemctl disable firewalld</pre>
<p><strong>禁用</strong>： </p>
<pre>systemctl stop firewalld</pre>
<p>&nbsp;</p>
<h1 id="hid-xtGNw2">2.systemctl是CentOS7的服务管理工具中主要的工具，它融合之前service和chkconfig的功能于一体。</h1>
<p><strong>启动一个服务</strong>：</p>
<pre>systemctl start firewalld.service</pre>
<p><strong>关闭一个服务</strong>：</p>
<pre>systemctlstop firewalld.service</pre>
<p><strong>重启一个服务</strong>：</p>
<pre>systemctlrestart firewalld.service</pre>
<p><strong>显示一个服务的状态</strong>：</p>
<pre>systemctlstatus firewalld.service</pre>
<p><strong>在开机时启用一个服务</strong>：</p>
<pre>systemctlenable firewalld.service</pre>
<p><strong>在开机时禁用一个服务</strong>：</p>
<pre>systemctldisable firewalld.service</pre>
<p><strong>查看服务是否开机启动</strong>：</p>
<pre>systemctlis-enabled firewalld.service</pre>
<p><strong>查看已启动的服务列表</strong>：</p>
<pre>systemctllist-unit-files|grep enabled</pre>
<p><strong>查看启动失败的服务列表</strong>：</p>
<pre>systemctl--failed</pre>
<h1>3.配置firewalld-cmd</h1>
<p><strong>查看版本</strong>： </p>
<pre>firewall-cmd --version</pre>
<p><strong>查看帮助</strong>： </p>
<pre>firewall-cmd --help</pre>
<p><strong>显示状态</strong>： </p>
<pre>firewall-cmd --state</pre>
<p><strong>查看所有打开的端口</strong>： </p>
<pre>firewall-cmd--zone=public --list-ports</pre>
<p><strong>更新防火墙规则</strong>： </p>
<pre>firewall-cmd --reload</pre>
<p><strong>查看区域信息</strong>:  </p>
<pre>firewall-cmd--get-active-zones</pre>
<p><strong>查看指定接口所属区域</strong>： </p>
<pre>firewall-cmd--get-zone-of-interface=eth0</pre>
<p><strong>拒绝所有包</strong>：</p>
<pre>firewall-cmd --panic-on</pre>
<p><strong>取消拒绝状态</strong>： </p>
<pre>firewall-cmd --panic-off</pre>
<p><strong>查看是否拒绝</strong>： </p>
<pre>firewall-cmd --query-panic</pre>
<p>那怎么<strong>开启一个端口</strong>呢</p>
<p><strong>添加</strong></p>
<pre>firewall-cmd --zone=public --add-port=80/tcp --permanent</pre>
<p>   （&#8211;permanent永久生效，没有此参数重启后失效）</p>
<p><strong>重新载入</strong></p>
<pre>firewall-cmd --reload</pre>
<p><strong>查看</strong></p>
<pre>firewall-cmd --zone=public --query-port=80/tcp</pre>
<p><strong>删除</strong></p>
<pre>firewall-cmd --zone=public --remove-port=80/tcp --permanent</pre>
<p>查看firewall是否运行,下面两个命令都可以</p>
<pre>systemctl status firewalld.service</pre>
<pre>firewall-cmd --state</pre>
<p>查看当前开了哪些端口</p>
<p>其实一个服务对应一个端口，每个服务对应/usr/lib/firewalld/services下面一个xml文件。</p>
<pre>firewall-cmd --list-services</pre>
<p>查看还有哪些服务可以打开</p>
<pre>firewall-cmd --get-services</pre>
<p>查看所有打开的端口：</p>
<pre>firewall-cmd --zone=public --list-ports</pre>
<p>更新防火墙规则：</p>
<pre>firewall-cmd --reload</pre>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/2686.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Debian/Ubuntu/CentOS 网络重装一键脚本</title>
		<link>https://p1e.cn/html/2513.html</link>
					<comments>https://p1e.cn/html/2513.html#respond</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Mon, 08 Feb 2021 05:57:21 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://www.815494.com/?p=2513</guid>

					<description><![CDATA[本一键脚本在萌咖大佬的脚本基础上开发，实现了懒人式一键网络重装 Debian / Ubuntu / CentOS 系统及dd方式安装系统。解决了云服务商提供模板镜像体积过大、预装软件过多、不够纯净等问题。 默认登录密码： CentOS：Pwd@CentOS 其他 Linux 系统：Pwd@Linux 使用方法 wget --no-check-certificate -O AutoReinstall.sh https://p1e.cn/html/shell/reinstall/AutoReinstall.sh &#038;am]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="size-full wp-image-2514 aligncenter" src="https://i.p1e.cn/2021/02/1612763639-2336802514.jpg" alt="" width="800" height="600" /><br />
本一键脚本在萌咖大佬的脚本基础上开发，实现了懒人式一键网络重装 Debian / Ubuntu / CentOS 系统及dd方式安装系统。解决了云服务商提供模板镜像体积过大、预装软件过多、不够纯净等问题。</p>
<p><strong>默认登录密码：</strong></p>
<ul class=" list-paddingleft-2">
<li>CentOS：<code>Pwd@CentOS</code></li>
<li>其他 Linux 系统：<code>Pwd@Linux</code></li>
</ul>
<p>使用方法</p>
<pre>wget --no-check-certificate -O AutoReinstall.sh https://p1e.cn/html/shell/reinstall/AutoReinstall.sh &amp;&amp; bash AutoReinstall.sh</pre>
<h1>支持重装的系统</h1>
<ul>
<li>Ubuntu 18.04/16.04</li>
<li>Debian 9/10</li>
<li>CentOS 6</li>
<li>CentOS 7 （DD方式）</li>
<li>自定义DD镜像</li>
</ul>
<h1>特性 / 优化</h1>
<ul>
<li>自动获取IP地址、网关、子网掩码</li>
<li>自动判断网络环境，选择国内/外镜像，解决速度慢的问题</li>
<li>懒人一键化，无需复杂的命令</li>
<li>解决萌咖脚本中一些导致安装错误的问题</li>
<li>CentOS 7 镜像抛弃LVM，回归ext4，减少不稳定因素</li>
</ul>
<h1>注意</h1>
<ul>
<li>重装后系统密码均在脚本中有提供，<strong>安装后请尽快修改密码</strong>，Linux系统建议启用密钥登陆。</li>
<li>OpenVZ / LXC 架构系统不适用</li>
</ul>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/2513.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>把腾讯云主机CentOS源更换成内网</title>
		<link>https://p1e.cn/html/2338.html</link>
					<comments>https://p1e.cn/html/2338.html#respond</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Fri, 29 Jan 2021 01:10:49 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[腾讯云]]></category>
		<guid isPermaLink="false">https://www.815494.com/?p=2338</guid>

					<description><![CDATA[备份系统旧配置文件 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 获取对应版本的CentOS-Base.repo 到/etc/yum.repos.d/目录 各版本源配置列表 CentOS5 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.tencentyun.com/repo/centos5_base.repo CentOS6 wget -O]]></description>
										<content:encoded><![CDATA[<h2 id="_1">备份系统旧配置文件</h2>
<div class="codehilite">
<pre>mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
</pre>
</div>
<h2 id="centos-baserepo-etcyumreposd">获取对应版本的CentOS-Base.repo 到/etc/yum.repos.d/目录</h2>
<h3 id="centos_1">各版本源配置列表</h3>
<h4 id="centos5">CentOS5</h4>
<div class="codehilite">
<pre>wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.tencentyun.com/repo/centos5_base.repo
</pre>
</div>
<h4 id="centos6">CentOS6</h4>
<div class="codehilite">
<pre>wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.tencentyun.com/repo/centos6_base.repo
</pre>
</div>
<h4 id="centos7">CentOS7</h4>
<div class="codehilite">
<pre>wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.tencentyun.com/repo/centos7_base.repo
</pre>
</div>
<h4 id="centos8">CentOS8</h4>
<div class="codehilite">
<pre>wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.tencentyun.com/repo/centos8_base.repo
</pre>
</div>
<h2 id="_3">更新缓存</h2>
<div class="codehilite">
<pre>yum clean all
yum makecache
</pre>
<p>如需公网访问地址，请把mirrors.tencentyun.com替换成下面的：<br />
http://mirrors.cloud.tencent.com/</p>
<p>http://mirrors.tencent.com/</p>
</div>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/2338.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>centos同步时间</title>
		<link>https://p1e.cn/html/2007.html</link>
					<comments>https://p1e.cn/html/2007.html#respond</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Sat, 04 Apr 2020 10:41:59 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[Centos]]></category>
		<guid isPermaLink="false">https://www.815494.com/?p=2007</guid>

					<description><![CDATA[最近更新博文，显示的发布时间总是显示N分钟后，估计就是服务器时间不对了，下面雨辰跟大家一起复习下centos关于时间方面的一些命令。 1.查看时间]]></description>
										<content:encoded><![CDATA[<p>最近更新博文，显示的发布时间总是显示N分钟后，估计就是服务器时间不对了，下面雨辰跟大家一起复习下centos关于时间方面的一些命令。</p>
<p>1.查看时间</p>
<pre>[root@yuchen ~]# date
Thu Apr 4 11:24:24 CST 2020</pre>
<p>2.使用date -s修改时间</p>
<pre>[root@yuchen ~]# date -s "2020/4/4 11:26" 
Thu Apr  4 11:26:00 CST 2020</pre>
<p>3.修改时区</p>
<pre>使用新的时区文件覆盖系统默认时区
 # cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime</pre>
<p>4.安装ntpdate</p>
<pre>yum install ntpdate -y</pre>
<p>5.同步网络时间</p>
<pre>ntpdate ntp1.aliyun.com</pre>
<p>6.保存为bios时间</p>
<pre>同步BIOS时钟，强制将系统时间写入CMOS，使之永久生效，避免系统重启后恢复成原时间。
# clock -w</pre>
<p>7.设置crontab同步时间</p>
<pre>59 23 * * *    ntpdate ntp1.aliyun.com</pre>
<pre>*　　*　　*　　*　　*　　command 
分　时　日　月　周　命令 
第1列表示分钟1～59 每分钟用*或者 */1表示 
第2列表示小时1～23（0表示0点） 
第3列表示日期1～31 
第4列表示月份1～12 
第5列标识号星期0～6（0表示星期天） 
第6列要运行的命令</pre>
<p>8.查看bios时间</p>
<pre>[root@bogon ~]# hwclock  -r
Thu 04 Apr 2019 11:35:20 AM CST  -0.365289 seconds</pre>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/2007.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>一键网络重装系统 – 魔改版（适用于Linux / Windows / ISO安装 / PXE安装）</title>
		<link>https://p1e.cn/html/734.html</link>
					<comments>https://p1e.cn/html/734.html#comments</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Sun, 08 Dec 2019 05:47:45 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[windows]]></category>
		<guid isPermaLink="false">http://www.815494.com/?p=734</guid>

					<description><![CDATA[所有系统除特殊说明外，安装完毕的默认密码是815494.com，你必须在安装完毕立刻修改默认密码！ 特别注意：DD包名称带有efi的,仅支持在Uefi启动的机器上使用，例如：甲骨文 近3次更新日志: 16.2023.1.30 新增一键DD CloudCone Win10 16.2023.1.21 修复部分BUG，增加对腾讯云主机的优化 15.2022.8.10 新增自定义SSH端口，增加大量系统镜像，修复Centos7下出现 Error! Not Found grub的错误提示，新增支持xz压缩格式的dd系统镜像包]]></description>
										<content:encoded><![CDATA[<p>所有系统除特殊说明外，安装完毕的默认密码是<strong style="color: #e60000;">815494.com</strong>，你必须在安装完毕立刻修改默认密码！</p>
<pre><strong>特别注意：DD包名称带有efi的,仅支持在Uefi启动的机器上使用，例如：甲骨文</strong></pre>
<hr />
<p><strong>近3次更新日志</strong>:</p>
<ul>
<li>16.2023.1.30 新增一键DD CloudCone Win10</li>
<li>16.2023.1.21 修复部分BUG，增加对腾讯云主机的优化</li>
<li>15.2022.8.10 新增自定义SSH端口，增加大量系统镜像，修复Centos7下出现 Error! Not Found grub的错误提示，新增支持xz压缩格式的dd系统镜像包。</li>
<li>14.2022.1.10 脚本大更新</li>
<li>13.2021.9.02 新增对 Oracle 全面支持. 可支持从 Ubuntu, Oracle Linux 等系统重装<span style="color: #ff0000;">debian9-11</span>.</li>
</ul>
<p><strong>安装重装系统的前提组件</strong><br />
①. RedHat/CentOS:</p>
<pre>yum install -y xz openssl gawk file wget</pre>
<p>②. Debian/Ubuntu:</p>
<pre>apt-get install -y xz-utils openssl gawk file wget</pre>
<hr />
<h3>新版脚本体验</h3>
<pre>wget --no-check-certificate https://p1e.cn/html/shell/dd/NewReinstall.sh &amp;&amp; chmod a+x NewReinstall.sh &amp;&amp; bash NewReinstall.sh</pre>
<h3>老版脚本体验（带进度条）</h3>
<pre>wget --no-check-certificate https://p1e.cn/html/shell/dd/AutoReinstall.sh &amp;&amp; chmod a+x AutoReinstall.sh &amp;&amp; bash AutoReinstall.sh</pre>
<p>恭喜，你已经完成了系统重装，享受当下的美好</p>
<p>当您执行完上面的2行命令，你的服务器将开始网络重装纯净系统。在完成安装前，您将无法进行连接管理。</p>
<p>因硬件配置和网络环境不同，安装需要15-60分钟，请耐心等待。安装完成即可通过IP:22(Linux SSH)/IP:3389(Windows RDP)进行连接。<img loading="lazy" decoding="async" class="alignnone size-full wp-image-3150" src="https://i.p1e.cn/2019/12/blog202201200752301642665150-QQ图片20220120152847.png" alt="" width="647" height="669" /><br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-3208" src="https://i.p1e.cn/2019/12/blog202208120216291660270589-1660270568529.png" alt="" width="512" height="778" /></p>
<p>1、CentOS 7.7 (已关闭防火墙及SELinux，默认密码Pwd@CentOS)<br />
2、CentOS 7 (默认密码cxthhhhh.com)<br />
3、CentOS 7 (支持ARM64、UEFI，默认密码cxthhhhh.com)<br />
4、CentOS 8 (默认密码cxthhhhh.com)<br />
5、Rocky 8 (默认密码cxthhhhh.com)<br />
6、Rocky 8 (支持UEFI，默认密码cxthhhhh.com)<br />
7、Rocky 8 (支持ARM64、UEFI，默认密码cxthhhhh.com)<br />
8、CentOS 9 (默认密码cxthhhhh.com)<br />
9、CentOS 6 (官方源原版，默认密码815494.com)<br />
10、Debian 11 (官方源原版，默认密码815494.com)<br />
11、Debian 10 (官方源原版，默认密码815494.com)<br />
12、Debian 9 (官方源原版，默认密码815494.com)<br />
13、Debian 8 (官方源原版，默认密码815494.com)<br />
14、Ubuntu 20.04 (官方源原版，默认密码815494.com)<br />
15、Ubuntu 18.04 (官方源原版，默认密码815494.com)<br />
16、Ubuntu 16.04 (官方源原版，默认密码815494.com)<br />
17、Windows Server 2022 (默认密码cxthhhhh.com)<br />
18、Windows Server 2022 (支持UEFI，默认密码cxthhhhh.com)<br />
19、Windows Server 2019 (默认密码cxthhhhh.com)<br />
20、Windows Server 2016 (默认密码cxthhhhh.com)<br />
21、Windows Server 2012 (默认密码cxthhhhh.com)<br />
22、Windows Server 2008 (默认密码cxthhhhh.com)<br />
23、Windows 10 LTSC (支持CloudCone默认密码ievo.top)<br />
24、Windows 10 LTSC (默认密码Teddysun.com)<br />
25、Windows 10 专业版 (原版未精简，默认密码Vicer)<br />
26、Windows 7 x86 Lite (默认密码nat.ee)<br />
27、Windows 7 x86 Lite (阿里云专用，默认密码nat.ee)<br />
28、Windows 7 x64 Lite (默认密码nat.ee)<br />
29、Windows 7 x64 Lite (支持UEFI，默认密码nat.ee)<br />
30、Windows 10 LTSC Lite (默认密码nat.ee)<br />
31、Windows 10 LTSC Lite (阿里云专用，默认密码nat.ee)<br />
32、Windows 10 LTSC Lite (支持UEFI，默认密码nat.ee)<br />
33、Windows Server 2003 Lite (C盘默认10G，默认密码WinSrv2003x86-Chinese)<br />
34、Windows Server 2008 Lite (默认密码nat.ee)<br />
35、Windows Server 2008 Lite (支持UEFI，默认密码nat.ee)<br />
36、Windows Server 2012 Lite (默认密码nat.ee)<br />
37、Windows Server 2012 Lite (支持UEFI，默认密码nat.ee)<br />
38、Windows Server 2016 Lite (默认密码nat.ee)<br />
39、Windows Server 2016 Lite (支持UEFI，默认密码nat.ee)<br />
40、Windows Server 2022 Lite (默认密码nat.ee)<br />
41、Windows Server 2022 Lite (支持UEFI，默认密码nat.ee)</p>
<p><strong>历史更新日志</strong>:</p>
<blockquote><p>12.2021.8.16 修复上次更新错误，支持debian11</p>
<p>11.2021.8.11 修改了源系统链接，更新了部分镜像包</p>
<p>10.2021.3.11 合并脚本，自动选择境内外源</p>
<p>9.2021.1.27 新增一个脚本适用于国内重装系统</p>
<p>8.2021.1.25 脚本升级到2.0</p>
<p>7.2021.1.24 win系统镜像升级中，请暂时不要使用win镜像</p>
<p>6.2021.1.23  修复部分BUG</p>
<p>5.2019.12.28 添加老司机2003精简版</p>
<p>4.2019.12.12 添加老司机WinSrv2012r2x64-数据中心版</p>
<p>3.2019.12.7 新增自动安装脚本</p>
<p>2.2019.12.5 添加老司机win10精简版</p>
<p>1.2019.9.25更新支持centos8</p></blockquote>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/734.html/feed</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>centos ssh客户端设置密钥登录/免密登录</title>
		<link>https://p1e.cn/html/1587.html</link>
					<comments>https://p1e.cn/html/1587.html#respond</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Fri, 06 Dec 2019 01:34:19 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[ssh]]></category>
		<guid isPermaLink="false">https://www.815494.com/?p=1587</guid>

					<description><![CDATA[一、密钥登录：在日常工作中我们大多时候使用的是ssh客户端工具进行远程连接服务器，市面上的客户端工具很多，但是常用的就那么几个，本次只说明常用的几款 1、putty 在服务器端需要密钥认证的用户家目录下做如下操作： 　　　　mkdir /root/.ssh #创建 .ssh 目录 　　　　chmod 700 /root/.ssh/ # 修改目录权限为所属用户可读、可写、可执行 　　　　vi /root/.ssh/authorized_keys #创建公钥存放文件 双击打开puttygen.exe文件，打开如下窗口：]]></description>
										<content:encoded><![CDATA[<p>一、密钥登录：在日常工作中我们大多时候使用的是ssh客户端工具进行远程连接服务器，市面上的客户端工具很多，但是常用的就那么几个，本次只说明常用的几款</p>
<p>1、putty</p>
<p>在服务器端需要密钥认证的用户家目录下做如下操作：</p>
<div class="cnblogs_code">
<pre>　　　　mkdir /root/.ssh   #创建 .ssh 目录

　　　　chmod 700 /root/.ssh/    # 修改目录权限为所属用户可读、可写、可执行

　　　　vi /root/.ssh/authorized_keys    #创建公钥存放文件</pre>
</div>
<p>双击打开puttygen.exe文件，打开如下窗口：</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1588" src="https://p1e.cn/wp-json/cs/v1/1588" width="493" height="478" /></p>
<p>选择好加密方式以及公钥字符长度，然后点击generate即可，如下图：（如果未设置密码则可以免密登录）</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1589" src="https://p1e.cn/wp-json/cs/v1/1589" width="493" height="478" /></p>
<p>将生成的公钥以及私钥保存到本地后</p>
<p>将公钥复制到 authorized_keys 公钥保存文件中即可。</p>
<p>打开putty工具进行如下设置：</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1590" src="https://p1e.cn/wp-json/cs/v1/1590" width="466" height="449" /></p>
<p>找到之前存放的私钥，再记性session设置，下次可以快速登录：</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1591" src="https://p1e.cn/wp-json/cs/v1/1591" width="466" height="449" /></p>
<p>打开输入用户名即可登录，如果不想输入用户，且固定是以某个用户登录，例如使用root登录则可以按照如下方法进行设置</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1592" src="https://p1e.cn/wp-json/cs/v1/1592" width="466" height="449" /></p>
<p>2、xshell</p>
<p>在服务器端需要密钥认证的用户家目录下做如下操作：</p>
<div class="cnblogs_code">
<pre>　　　　mkdir /root/.ssh   #创建 .ssh 目录

　　　　chmod 700 /root/.ssh/    # 修改目录权限为所属用户可读、可写、可执行

　　　　vi /root/.ssh/authorized_keys    #创建公钥存放文件</pre>
</div>
<p>然后去xshell官网下载学习或者教学使用版本即是免费的版本，安装。</p>
<p>打开xshell连接linux服务端，然后在菜单栏中找到   工具 &#8211;&gt;新建用户密钥生成向导，如下图</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1593" src="https://p1e.cn/wp-json/cs/v1/1593" width="549" height="484" /></p>
<p>密钥类型：RSA、DSA、ECDSA、ED25519可供选择，密钥长度可选择1024或者2048，选择好后点击下一步</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1594" src="https://p1e.cn/wp-json/cs/v1/1594" width="549" height="484" /></p>
<p>再次下一步出现如下界面，根据自己需求进行设置是否需要对密钥进行自定义密码，如果为空则登录时候为免密自动登录</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1595" src="https://p1e.cn/wp-json/cs/v1/1595" width="549" height="484" /></p>
<p>如果不设置密码则点击下一步会提示密码为空，此处点击是即可生成公钥如下图所示：</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1596" src="https://p1e.cn/wp-json/cs/v1/1596" width="549" height="484" /></p>
<p>将生成的公钥复制到之前在用户家目录.ssh 目录下创建的 authorized_keys 文件中</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1597" src="https://p1e.cn/wp-json/cs/v1/1597" width="1011" height="92" /></p>
<p>退出xsell后重新连接，新建连接如下：</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1598" src="https://p1e.cn/wp-json/cs/v1/1598" width="672" height="214" /></p>
<p>用户登录时选择public_key，并且选择密钥，填写给密钥设置的密码，如下图所示：</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1599" src="https://p1e.cn/wp-json/cs/v1/1599" width="667" height="327" /></p>
<p>全部设置完成后点击连接，即可密钥方式登录（免密登录）</p>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/1587.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
