{"id":62086,"date":"2025-04-29T08:34:20","date_gmt":"2025-04-29T00:34:20","guid":{"rendered":"https:\/\/fwq.ai\/blog\/62086\/"},"modified":"2025-04-29T08:34:20","modified_gmt":"2025-04-29T00:34:20","slug":"centos-7-%e7%b3%bb%e7%bb%9f%e4%bc%98%e5%8c%96%e8%84%9a%e6%9c%ac-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/62086\/","title":{"rendered":"CentOS 7 \u7cfb\u7edf\u4f18\u5316\u811a\u672c"},"content":{"rendered":"<p>  <\/p>\n<p style=\"margin: 0px 0px 0em;padding: 0px;max-width: 100%;clear: both;min-height: 1em;font-family: system-ui, -apple-system, BlinkMacSystemFont,\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/eaa00214cd0840af5919136babfd1356-0.png\" class=\"aligncenter\" title=\"CentOS 7 \u7cfb\u7edf\u4f18\u5316\u811a\u672c\u63d2\u56fe\" alt=\"CentOS 7 \u7cfb\u7edf\u4f18\u5316\u811a\u672c\u63d2\u56fe\" \/><\/p>\n<p style=\"margin: 0px;padding: 0px;max-width: 100%;clear: both;min-height: 1em;font-family: system-ui, -apple-system, BlinkMacSystemFont,\"><\/p>\n<h3> <span style=\"margin: 0px 3px 0px 0px;padding: 3px 10px 0px;max-width: 100%;font-size: inherit;line-height: inherit;font-weight: normal;border-top-right-radius: 3px;border-top-left-radius: 3px\">\u4e00\u3001\u4ecb\u7ecd<\/span><span style=\"margin: 0px;padding: 0px;max-width: 100%;vertical-align: bottom;border-bottom-width: 36px;border-bottom-style: solid;border-right-width: 20px;border-right-style: solid;border-right-color: transparent\"><\/span> <\/h3>\n<p style=\"margin: 1.5em 0px;padding: 0px;max-width: 100%;clear: both;min-height: 1em;font-size: inherit;color: inherit;line-height: inherit\">\u4f5c\u4e3a\u4e00\u540d\u8fd0\u7ef4\uff0c\u7ecf\u5e38\u4f1a\u90e8\u7f72\u5404\u79cd\u7528\u9014\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u4f46\u5728\u8fd9\u4e9b\u5de5\u4f5c\u4e2d\uff0c\u6211\u4eec\u4f1a\u53d1\u73b0\u5f88\u591a\u5de5\u4f5c\u5176\u5b9e\u662f\u91cd\u590d\u6027\u7684\u52b3\u52a8\uff0c\u64cd\u4f5c\u7684\u5185\u5bb9\u4e5f\u662f\u5927\u540c\u5c0f\u5f02\uff0c\u57fa\u4e8e\u8fd9\u7c7b\u60c5\u51b5\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u76f8\u540c\u7684\u64cd\u4f5c\u505a\u6210\u7edf\u4e00\u6267\u884c\u7684\u811a\u672c\uff0c\u4e0d\u540c\u7684\u4e1c\u897f\u4f5c\u4e3a\u53d8\u91cf\u624b\u52a8\u8f93\u5165\u3002\u8282\u7ea6\u4e0b\u6765\u7684\u65f6\u95f4\u4e0d\u5c31\u53ef\u4ee5\u505a\u66f4\u591a\u6709\u610f\u4e49\u7684\u4e8b\u60c5\u5417\uff1f<\/p>\n<p style=\"margin: 1.5em 0px;padding: 0px;max-width: 100%;clear: both;min-height: 1em;font-size: inherit;color: inherit;line-height: inherit\">\u6700\u8fd1\u5728\u7c89\u4e1d\u6709\u63a8\u8350\u4e0b\u53d1\u73b0\u4e00\u6b3e\u6bd4\u8f83\u597d\u7528\u7684shell\u6e90\u7801\uff0c\u4e5f\u57fa\u4e8e\u6b64\u6539\u7f16\u4e86\u4e00\u4e0b\uff0c\u5206\u4eab\u7ed9\u5927\u5bb6\u3002<\/p>\n<h3> <span style=\"margin: 0px 3px 0px 0px;padding: 3px 10px 0px;max-width: 100%;font-size: inherit;line-height: inherit;font-weight: normal;border-top-right-radius: 3px;border-top-left-radius: 3px\">\u4e8c\u3001\u83dc\u5355<\/span><span style=\"margin: 0px;padding: 0px;max-width: 100%;vertical-align: bottom;border-bottom-width: 36px;border-bottom-style: solid;border-right-width: 20px;border-right-style: solid;border-right-color: transparent\"><\/span> <\/h3>\n<p style=\"margin: 1.5em 0px;padding: 0px;max-width: 100%;clear: both;min-height: 1em;font-size: inherit;color: inherit;line-height: inherit\">\u4e3b\u83dc\u5355\uff1a<\/p>\n<p style=\"margin: 1.5em 0px;padding: 0px;max-width: 100%;clear: both;min-height: 1em;font-size: inherit;color: inherit;line-height: inherit\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/eaa00214cd0840af5919136babfd1356-1.png\" class=\"aligncenter\" title=\"CentOS 7 \u7cfb\u7edf\u4f18\u5316\u811a\u672c\u63d2\u56fe1\" alt=\"CentOS 7 \u7cfb\u7edf\u4f18\u5316\u811a\u672c\u63d2\u56fe1\" \/><\/p>\n<p style=\"margin: 1.5em 0px;padding: 0px;max-width: 100%;clear: both;min-height: 1em;font-size: inherit;color: inherit;line-height: inherit\">\u4e8c\u7ea7\u83dc\u5355\uff1a<\/p>\n<p style=\"margin: 1.5em 0px;padding: 0px;max-width: 100%;clear: both;min-height: 1em;font-size: inherit;color: inherit;line-height: inherit\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/5e386c3ae209d47726d2f7f914fc7518-2.png\" class=\"aligncenter\" title=\"CentOS 7 \u7cfb\u7edf\u4f18\u5316\u811a\u672c\u63d2\u56fe2\" alt=\"CentOS 7 \u7cfb\u7edf\u4f18\u5316\u811a\u672c\u63d2\u56fe2\" \/><\/p>\n<p style=\"margin: 1.5em 0px;padding: 0px;max-width: 100%;clear: both;min-height: 1em;font-size: inherit;color: inherit;line-height: inherit\">\u4e3b\u8981\u5b9e\u73b0\u7cfb\u7edf\u7684\u5404\u7c7b\u4f18\u5316\uff0c\u6bd4\u5982\u5e38\u7528\u7684\u4fee\u6539\u5b57\u7b26\u96c6\u3001\u5173\u95edselinux\u3001\u5173\u95ed\u9632\u706b\u5899\u3001\u5b89\u88c5\u5e38\u7528\u5de5\u5177\u548c\u52a0\u5febssh\u767b\u5f55\u7b49\u529f\u80fd\u3002<\/p>\n<pre>\u725b\u903c\u554a\uff01\u63a5\u79c1\u6d3b\u5fc5\u5907\u7684&nbsp;N&nbsp;\u4e2a\u5f00\u6e90\u9879\u76ee\uff01\u8d76\u5feb\u6536\u85cf\u5427<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<h3> <span style=\"margin: 0px 3px 0px 0px;padding: 3px 10px 0px;max-width: 100%;font-size: inherit;line-height: inherit;font-weight: normal;border-top-right-radius: 3px;border-top-left-radius: 3px\">\u4e09\u3001\u6e90\u7801<\/span><span style=\"margin: 0px;padding: 0px;max-width: 100%;vertical-align: bottom;border-bottom-width: 36px;border-bottom-style: solid;border-right-width: 20px;border-right-style: solid;border-right-color: transparent\"><\/span> <\/h3>\n<pre>#!\/bin\/sh\n\n.&nbsp;\/etc\/rc.d\/init.d\/functions\nexport&nbsp;LANG=zh_CN.UTF-8\n\n#\u4e00\u7ea7\u83dc\u5355\nmenu1()\n{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clear\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cat&nbsp;&nbsp;\/etc\/locale.conf&nbsp;&nbsp;\/dev\/null\n&nbsp;echo&nbsp;'#firewall-cmd&nbsp;&nbsp;--state'\n&nbsp;firewall-cmd&nbsp;&nbsp;--state\n&nbsp;systemctl&nbsp;disable&nbsp;firewalld.service&nbsp;&amp;amp;&amp;gt;&nbsp;\/dev\/null\n&nbsp;echo&nbsp;'#systemctl&nbsp;list-unit-files&nbsp;|&nbsp;grep&nbsp;firewalld'\n&nbsp;systemctl&nbsp;list-unit-files&nbsp;|&nbsp;grep&nbsp;firewalld\n&nbsp;action&nbsp;\"\u5b8c\u6210\u7981\u7528firewalld\uff0c\u751f\u4ea7\u73af\u5883\u4e0b\u5efa\u8bae\u542f\u7528\uff01\"&nbsp;\/bin\/true\n&nbsp;echo&nbsp;\"===========================================================\"\n&nbsp;sleep&nbsp;5\n}\n\n#4.\u7cbe\u7b80\u5f00\u673a\u542f\u52a8\nchkset()\n{\n&nbsp;echo&nbsp;\"=======================\u7cbe\u7b80\u5f00\u673a\u542f\u52a8========================\"\n&nbsp;systemctl&nbsp;disable&nbsp;auditd.service\n&nbsp;systemctl&nbsp;disable&nbsp;postfix.service\n&nbsp;systemctl&nbsp;disable&nbsp;dbus-org.freedesktop.NetworkManager.service\n&nbsp;echo&nbsp;'#systemctl&nbsp;list-unit-files&nbsp;|&nbsp;grep&nbsp;-E&nbsp;\"auditd|postfix|dbus-org.freedesktop.NetworkManager\"'\n&nbsp;systemctl&nbsp;list-unit-files&nbsp;|&nbsp;grep&nbsp;-E&nbsp;\"auditd|postfix|dbus-org.freedesktop.NetworkManager\"\n&nbsp;action&nbsp;\"\u5b8c\u6210\u7cbe\u7b80\u5f00\u673a\u542f\u52a8\"&nbsp;\/bin\/true\n&nbsp;echo&nbsp;\"===========================================================\"\n&nbsp;sleep&nbsp;2\n}\n\n#5.\u4fee\u6539\u6587\u4ef6\u63cf\u8ff0\u7b26\nlimitset()\n{\n&nbsp;echo&nbsp;\"======================\u4fee\u6539\u6587\u4ef6\u63cf\u8ff0\u7b26=======================\"\n&nbsp;echo&nbsp;'*&nbsp;-&nbsp;nofile&nbsp;65535'&amp;gt;\/etc\/security\/limits.conf\n&nbsp;ulimit&nbsp;-SHn&nbsp;65535\n&nbsp;echo&nbsp;\"#cat&nbsp;\/etc\/security\/limits.conf\"\n&nbsp;cat&nbsp;\/etc\/security\/limits.conf\n&nbsp;echo&nbsp;\"#ulimit&nbsp;-Sn&nbsp;;&nbsp;ulimit&nbsp;-Hn\"\n&nbsp;ulimit&nbsp;-Sn&nbsp;;&nbsp;ulimit&nbsp;-Hn\n&nbsp;action&nbsp;\"\u5b8c\u6210\u4fee\u6539\u6587\u4ef6\u63cf\u8ff0\u7b26\"&nbsp;\/bin\/true\n&nbsp;echo&nbsp;\"===========================================================\"\n&nbsp;sleep&nbsp;2\n}\n\n#6.\u5b89\u88c5\u5e38\u7528\u5de5\u5177\u53ca\u4fee\u6539yum\u6e90\nyumset()\n{\n&nbsp;echo&nbsp;\"=================\u5b89\u88c5\u5e38\u7528\u5de5\u5177\u53ca\u4fee\u6539yum\u6e90===================\"\n&nbsp;yum&nbsp;install&nbsp;wget&nbsp;-y&nbsp;&amp;amp;&amp;gt;&nbsp;\/dev\/null\n&nbsp;if&nbsp;[&nbsp;$?&nbsp;-eq&nbsp;0&nbsp;];then\n&nbsp;&nbsp;cd&nbsp;\/etc\/yum.repos.d\/\n&nbsp;&nbsp;cp&nbsp;CentOS-Base.repo&nbsp;CentOS-Base.repo.$(date&nbsp;+%F)\n&nbsp;&nbsp;ping&nbsp;-c&nbsp;1&nbsp;mirrors.aliyun.com&nbsp;&amp;amp;&amp;gt;&nbsp;\/dev\/null\n&nbsp;&nbsp;if&nbsp;[&nbsp;$?&nbsp;-eq&nbsp;0&nbsp;];then\n&nbsp;&nbsp;&nbsp;wget&nbsp;-O&nbsp;\/etc\/yum.repos.d\/CentOS-Base.repo&nbsp;http:\/\/mirrors.aliyun.com\/repo\/Centos-7.repo&nbsp;&amp;amp;&amp;gt;&nbsp;\/dev\/null\n&nbsp;&nbsp;&nbsp;yum&nbsp;clean&nbsp;all&nbsp;&amp;amp;&amp;gt;&nbsp;\/dev\/null\n&nbsp;&nbsp;&nbsp;yum&nbsp;makecache&nbsp;&amp;amp;&amp;gt;&nbsp;\/dev\/null\n&nbsp;&nbsp;else\n&nbsp;&nbsp;&nbsp;echo&nbsp;\"\u65e0\u6cd5\u8fde\u63a5\u7f51\u7edc\"\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit&nbsp;$?\n&nbsp;&nbsp;&nbsp;&nbsp;fi\n&nbsp;else\n&nbsp;&nbsp;echo&nbsp;\"wget\u5b89\u88c5\u5931\u8d25\"\n&nbsp;&nbsp;exit&nbsp;$?\n&nbsp;fi\n&nbsp;yum&nbsp;-y&nbsp;install&nbsp;ntpdate&nbsp;lsof&nbsp;net-tools&nbsp;telnet&nbsp;vim&nbsp;lrzsz&nbsp;tree&nbsp;nmap&nbsp;nc&nbsp;sysstat&nbsp;&amp;amp;&amp;gt;&nbsp;\/dev\/null\n&nbsp;action&nbsp;\"\u5b8c\u6210\u5b89\u88c5\u5e38\u7528\u5de5\u5177\u53ca\u4fee\u6539yum\u6e90\"&nbsp;\/bin\/true\n&nbsp;echo&nbsp;\"===========================================================\"\n&nbsp;sleep&nbsp;2\n}\n\n#7.&nbsp;\u4f18\u5316\u7cfb\u7edf\u5185\u6838&nbsp;#\u53e6\u5916\uff0c\u641c\u7d22\u516c\u4f17\u53f7\u6280\u672f\u793e\u533a\u540e\u53f0\u56de\u590d\u201c\u58c1\u7eb8\u201d\uff0c\u83b7\u53d6\u4e00\u4efd\u60ca\u559c\u793c\u5305\u3002kernelset()\n{\n&nbsp;echo&nbsp;\"======================\u4f18\u5316\u7cfb\u7edf\u5185\u6838=========================\"\n&nbsp;chk_nf=`cat&nbsp;\/etc\/sysctl.conf&nbsp;|&nbsp;grep&nbsp;conntrack&nbsp;|wc&nbsp;-l`\n&nbsp;if&nbsp;[&nbsp;$chk_nf&nbsp;-eq&nbsp;0&nbsp;];then\n&nbsp;&nbsp;cat&nbsp;&amp;gt;&amp;gt;\/etc\/sysctl.conf&nbsp;\/dev\/null\n&nbsp;if&nbsp;[&nbsp;$?&nbsp;-eq&nbsp;0&nbsp;];then\n&nbsp;&nbsp;\/usr\/sbin\/ntpdate&nbsp;time.windows.com\n&nbsp;&nbsp;echo&nbsp;\"*\/5&nbsp;*&nbsp;*&nbsp;*&nbsp;*&nbsp;\/usr\/sbin\/ntpdate&nbsp;ntp.aliyun.com&nbsp;&amp;amp;&amp;gt;\/dev\/null\"&nbsp;&amp;gt;&amp;gt;&nbsp;\/var\/spool\/cron\/root\n&nbsp;else\n&nbsp;&nbsp;echo&nbsp;\"ntpdate\u5b89\u88c5\u5931\u8d25\"\n&nbsp;&nbsp;exit&nbsp;$?\n&nbsp;fi\n&nbsp;action&nbsp;\"\u5b8c\u6210\u8bbe\u7f6e\u65f6\u95f4\u540c\u6b65\"&nbsp;\/bin\/true\n&nbsp;echo&nbsp;\"===========================================================\"\n&nbsp;sleep&nbsp;2\n}\n\n#11.&nbsp;history\u4f18\u5316\nhistoryset()\n{\n&nbsp;echo&nbsp;\"========================history\u4f18\u5316========================\"\n&nbsp;chk_his=`cat&nbsp;\/etc\/profile&nbsp;|&nbsp;grep&nbsp;HISTTIMEFORMAT&nbsp;|wc&nbsp;-l`\n&nbsp;if&nbsp;[&nbsp;$chk_his&nbsp;-eq&nbsp;0&nbsp;];then\n&nbsp;&nbsp;cat&nbsp;&amp;gt;&amp;gt;&nbsp;\/etc\/profile&nbsp;&lt;p style=\"margin: 1.5em 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: break-word !important;\"&gt;\u5c06\u5176\u4fdd\u5b58\u4e3ainit.sh\uff0c\u7136\u540e\u8d4b\u4e88\u6267\u884c\u6743\u9650\u540e\u6267\u884c\u5373\u53ef\u3002&lt;\/p&gt;&lt;pre class=\"brush:php;toolbar:false;\"&gt;chmod&nbsp;+x&nbsp;init.sh&nbsp;&amp;amp;&amp;amp;&nbsp;.\/init.sh<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin: 1.5em 0px;padding: 0px;max-width: 100%;clear: both;min-height: 1em;font-size: inherit;color: inherit;line-height: inherit\">\u5982\u679c\u8fd9\u6837\u6765\u56de\u5730\u590d\u5236\u7c98\u8d34\u5f88\u9ebb\u70e6\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u6211\u7684\u4e00\u952e\u547d\u4ee4\u6267\u884c\uff0c\u540c\u6837\u80fd\u8fbe\u5230\u4e0a\u9762\u7684\u6548\u679c\uff1a<\/p>\n<pre>bash&nbsp;-c&nbsp;\"$(curl&nbsp;-L&nbsp;s.aaa.al\/init.sh)\"<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin: 1.5em 0px;padding: 0px;max-width: 100%;clear: both;min-height: 1em;font-size: inherit;color: inherit;line-height: inherit\">\u6700\u540e\uff0c\u5982\u679c\u5927\u5bb6\u6709\u60f3\u5b9e\u73b0\u7684\u529f\u80fd\uff0c\u4e5f\u53ef\u4ee5\u5728\u539f\u6709\u811a\u672c\u7684\u57fa\u7840\u4e0a\u8fdb\u884c\u4fee\u6539\u5b9e\u73b0\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fCentOS 7 \u7cfb\u7edf\u4f18\u5316\u811a\u672c\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u4ecb\u7ecd \u4f5c\u4e3a\u4e00\u540d\u8fd0\u7ef4\uff0c\u7ecf\u5e38\u4f1a\u90e8\u7f72\u5404\u79cd\u7528\u9014\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u4f46\u5728\u8fd9\u4e9b\u5de5\u4f5c\u4e2d\uff0c\u6211\u4eec\u4f1a\u53d1\u73b0\u5f88\u591a\u5de5\u4f5c\u5176\u5b9e\u662f\u91cd\u590d\u6027\u7684\u52b3\u52a8\uff0c\u64cd\u4f5c\u7684\u5185\u5bb9\u4e5f\u662f\u5927\u540c\u5c0f\u5f02\uff0c\u57fa\u4e8e\u8fd9\u7c7b\u60c5\u51b5\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u76f8\u540c\u7684\u64cd\u4f5c\u505a\u6210\u7edf\u4e00\u6267\u884c\u7684\u811a\u672c\uff0c\u4e0d\u540c\u7684\u4e1c\u897f\u4f5c\u4e3a\u53d8\u91cf\u624b\u52a8\u8f93\u5165\u3002\u8282\u7ea6\u4e0b\u6765\u7684\u65f6\u95f4\u4e0d\u5c31\u53ef\u4ee5\u505a\u66f4\u591a\u6709\u610f\u4e49\u7684\u4e8b\u60c5\u5417\uff1f \u6700\u8fd1\u5728\u7c89\u4e1d\u6709\u63a8\u8350\u4e0b\u53d1\u73b0\u4e00\u6b3e\u6bd4\u8f83\u597d\u7528\u7684shell\u6e90\u7801\uff0c\u4e5f\u57fa\u4e8e\u6b64\u6539\u7f16\u4e86\u4e00\u4e0b\uff0c\u5206\u4eab\u7ed9\u5927\u5bb6\u3002 \u4e8c\u3001\u83dc\u5355 \u4e3b\u83dc\u5355\uff1a \u4e8c\u7ea7\u83dc\u5355\uff1a \u4e3b\u8981\u5b9e\u73b0\u7cfb\u7edf\u7684\u5404\u7c7b\u4f18\u5316\uff0c\u6bd4\u5982\u5e38\u7528\u7684\u4fee\u6539\u5b57\u7b26\u96c6\u3001\u5173\u95edselinux\u3001\u5173\u95ed\u9632\u706b\u5899\u3001\u5b89\u88c5\u5e38\u7528\u5de5\u5177\u548c\u52a0\u5febssh\u767b\u5f55\u7b49\u529f\u80fd\u3002 \u725b\u903c\u554a\uff01\u63a5\u79c1\u6d3b\u5fc5\u5907\u7684&nbsp;N&nbsp;\u4e2a\u5f00\u6e90\u9879\u76ee\uff01\u8d76\u5feb\u6536\u85cf\u5427 \u767b\u5f55\u540e\u590d\u5236 \u4e09\u3001\u6e90\u7801 #!\/bin\/sh .&nbsp;\/etc\/rc.d\/init.d\/functions export&nbsp;LANG=zh_CN.UTF-8 #\u4e00\u7ea7\u83dc\u5355 menu1() { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clear &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cat&nbsp;&nbsp;\/etc\/locale.conf&nbsp;&nbsp;\/dev\/null &nbsp;echo&nbsp;&#8216;#firewall-cmd&nbsp;&nbsp;&#8211;state&#8217; &nbsp;firewall-cmd&nbsp;&nbsp;&#8211;state &nbsp;systemctl&nbsp;disable&nbsp;firewalld.service&nbsp;&amp;amp;&amp;gt;&nbsp;\/dev\/null &nbsp;echo&nbsp;&#8216;#systemctl&nbsp;list-unit-files&nbsp;|&nbsp;grep&nbsp;firewalld&#8217; &nbsp;systemctl&nbsp;list-unit-files&nbsp;|&nbsp;grep&nbsp;firewalld &nbsp;action&nbsp;&#8220;\u5b8c\u6210\u7981\u7528firewalld\uff0c\u751f\u4ea7\u73af\u5883\u4e0b\u5efa\u8bae\u542f\u7528\uff01&#8221;&nbsp;\/bin\/true &nbsp;echo&nbsp;&#8220;===========================================================&#8221; &nbsp;sleep&nbsp;5 } #4.\u7cbe\u7b80\u5f00\u673a\u542f\u52a8 chkset() { &nbsp;echo&nbsp;&#8220;=======================\u7cbe\u7b80\u5f00\u673a\u542f\u52a8========================&#8221; &nbsp;systemctl&nbsp;disable&nbsp;auditd.service &nbsp;systemctl&nbsp;disable&nbsp;postfix.service &nbsp;systemctl&nbsp;disable&nbsp;dbus-org.freedesktop.NetworkManager.service &nbsp;echo&nbsp;&#8216;#systemctl&nbsp;list-unit-files&nbsp;|&nbsp;grep&nbsp;-E&nbsp;&#8220;auditd|postfix|dbus-org.freedesktop.NetworkManager&#8221;&#8216; &nbsp;systemctl&nbsp;list-unit-files&nbsp;|&nbsp;grep&nbsp;-E&nbsp;&#8220;auditd|postfix|dbus-org.freedesktop.NetworkManager&#8221; &nbsp;action&nbsp;&#8220;\u5b8c\u6210\u7cbe\u7b80\u5f00\u673a\u542f\u52a8&#8221;&nbsp;\/bin\/true &nbsp;echo&nbsp;&#8220;===========================================================&#8221; &nbsp;sleep&nbsp;2 } #5.\u4fee\u6539\u6587\u4ef6\u63cf\u8ff0\u7b26 limitset() { &nbsp;echo&nbsp;&#8220;======================\u4fee\u6539\u6587\u4ef6\u63cf\u8ff0\u7b26=======================&#8221; &nbsp;echo&nbsp;&#8216;*&nbsp;&#8211;&nbsp;nofile&nbsp;65535&#8217;&amp;gt;\/etc\/security\/limits.conf &nbsp;ulimit&nbsp;-SHn&nbsp;65535 &nbsp;echo&nbsp;&#8220;#cat&nbsp;\/etc\/security\/limits.conf&#8221; &nbsp;cat&nbsp;\/etc\/security\/limits.conf &nbsp;echo&nbsp;&#8220;#ulimit&nbsp;-Sn&nbsp;;&nbsp;ulimit&nbsp;-Hn&#8221; &nbsp;ulimit&nbsp;-Sn&nbsp;;&nbsp;ulimit&nbsp;-Hn &nbsp;action&nbsp;&#8220;\u5b8c\u6210\u4fee\u6539\u6587\u4ef6\u63cf\u8ff0\u7b26&#8221;&nbsp;\/bin\/true &nbsp;echo&nbsp;&#8220;===========================================================&#8221; &nbsp;sleep&nbsp;2 } #6.\u5b89\u88c5\u5e38\u7528\u5de5\u5177\u53ca\u4fee\u6539yum\u6e90 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-62086","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/62086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=62086"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/62086\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=62086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=62086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=62086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}