id: 6c64ce2e399f45208a77437b5e11837a
parent_id: 
item_type: 1
item_id: 1c18826d76ba46849ef8bc54e038fffd
item_updated_time: 1764365027525
title_diff: "[{\"diffs\":[[1,\"生产环境超实用Shell脚本二\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":15}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>生产环境超实用Shell脚本二</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <meta name=\\\"content-class\\\" content=\\\"yinxiang.peso.superNote\\\"/>\\\r\\\n  <meta name=\\\"application-data:yinxiang.noteLayout\\\" content=\\\"{\\\"lineSpace\\\":\\\"recommend\\\",\\\"paragraphSpace\\\":\\\"recommend\\\"}\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"38961\\\"></a>\\\r\\\n<h1>生产环境超实用Shell脚本二</h1>\\\r\\\n\\\r\\\n<div><span style=\\\"margin:0px;\\\"><div style=\\\"padding:8px 0px;margin:8px auto;max-width:700px;\\\"> <div><span></span></div>\\\n<p></p>\\\n<div style=\\\"--en-blockquote:true;box-sizing: border-box; padding-left: 19px; padding-top: 6px; padding-bottom: 6px; border-left: 3px solid #b4c0cc; background-position: initial initial; background-repeat: initial initial; margin-top: 6px\\\"><div>原文链接: <a href=\\\"http://mp.weixin.qq.com/s?__biz=MzAxMDkyMTYyOQ==&amp;mid=2247487283&amp;idx=1&amp;sn=ca6c08533342caf4b6115e38ebdc80c8&amp;chksm=9afc042c1720a9416d87b6ce894448de9ec14a9ff7d17b1ceceaec503c4747d54cef71a04cf0&amp;mpshare=1&amp;scene=1&amp;srcid=03231AACd595U9oJjt51d4Lj&amp;sharer_shareinfo=7126823e7eca70c57d4fd0d5bd566f9f&amp;sharer_shareinfo_first=7126823e7eca70c57d4fd0d5bd566f9f#rd\\\"><span>http://mp.weixin.qq.com/s?__biz=MzAxMDkyMTYyOQ==&amp;mid=2247487...</span></a></div></div>\\\n<p></p>\\\n<div><span></span></div>\\\n<div style=\\\"\\\"><div><div><h1 style=\\\"margin:0\\\"> 生产环境超实用Shell脚本二 </h1><div><span style=\\\"position:relative\\\">原创</span><span> 我码玄黄 </span><span><a style=\\\"position:relative\\\"> 我码玄黄 </a></span><span><em></em></span></div><div style=\\\";\\\"><div style=\\\"line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: justify;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;margin-top: -10px;font-size: 15px;letter-spacing: 0.05em;color: #595959;padding: 5px;\\\"><h2 style=\\\"margin-top:30px;min-height:32px;line-height:28px;border-bottom:solid 1px #000;color:#773098;display:inline-block;border-bottom-width:1px;border-bottom-style:solid;border-color:#773098;padding-top:5px;padding-right:0.5em;padding-left:0.5em;margin-bottom:-3px;font-size:22px;margin:1em auto;padding:0.5em 0;text-align:center;width:85%;font-weight:bold;display:flex;flex-direction:column;justify-content:center\\\"><span><span>生产环境超实用Shell脚本二</span></span><span></span></h2><p style=\\\"font-size:16px;padding-top:8px;padding-bottom:8px;line-height:26px;color:black;margin:1em 4px\\\"><span>Shell脚本作为自动化运维的利器，在生产环境中扮演着至关重要的角色。</span></p><p style=\\\"font-size:16px;padding-top:8px;padding-bottom:8px;line-height:26px;color:black;margin:1em 4px\\\"><span>本文将介绍自动化部署脚本、用户管理脚本、 软件安装脚本、网络配置脚本，帮助您提升运维效率。</span></p><div style=\\\"margin: 0;margin-top: 10px;margin-bottom: 10px;\\\"><span><img src=\\\"生产环境超实用Shell脚本二_files/640.png\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;display: block;margin: 0 auto;width: auto;max-width: 100%;\\\"/></span></div><h2 style=\\\"margin-top:30px;min-height:32px;line-height:28px;border-bottom:solid 1px #000;color:#773098;display:inline-block;border-bottom-width:1px;border-bottom-style:solid;border-color:#773098;padding-top:5px;padding-right:0.5em;padding-left:0.5em;margin-bottom:-3px;font-size:22px;margin:1em auto;padding:0.5em 0;text-align:center;width:85%;font-weight:bold;display:flex;flex-direction:column;justify-content:center\\\"><span><span>1. 自动化部署脚本</span></span><span></span></h2><ul style=\\\"margin:0;margin-top:8px;margin-bottom:8px;padding-left:25px;color:black;list-style-type:disc\\\"><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><strong style=\\\"font-weight: bold;color: #773098;\\\"><span>功能:</span></strong><span> 自动化部署应用程序，包括代码拉取、依赖安装、配置修改、服务启动等。</span></div></li><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><strong style=\\\"font-weight: bold;color: #773098;\\\"><span>应用场景:</span></strong><span> 简化部署流程，提高部署效率，减少人为错误。</span></div></li><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><strong style=\\\"font-weight: bold;color: #773098;\\\"><span>示例代码:</span></strong></div></li></ul><pre style=\\\"margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\\\"><span style=\\\"display: block;background: none;height: 30px;width: 100%;background-size: 40px;background-repeat: no-repeat;background-color: #282c34;margin-bottom: -7px;border-radius: 5px;background-position: 10px 10px;background-image: url(&quot;https://mmbiz.qpic.cn/mmbiz_svg/V0mhkIwf3EH1JxUibAagrJ4kvmibgoG2RcFxIn3E4JUMWurHMuCp53tgcQpKeydtzjU1PEbgXsabsmRrcYy7ysRXiaquNnUxF2z/640?wx_fmt=svg&amp;from=appmsg&quot;);\\\"></span><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"color: #61aeee;line-height: 26px;\\\"><span>#!/bin/bash</span><br/></span><br/><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 定义项目目录和代码仓库地址</span></span><br/><span>project_dir=</span><span style=\\\"color: #98c379;line-height: 26px;\\\"><span>&quot;/var/www/myapp&quot;</span></span><br/><span>repo_url=</span><span style=\\\"color: #98c379;line-height: 26px;\\\"><span>&quot;git@github.com:user/myapp.git&quot;</span></span><br/><br/><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 拉取最新代码</span></span><br/><span style=\\\"color: #e6c07b;line-height: 26px;\\\"><span>cd</span></span><span> </span><span style=\\\"color: #d19a66;line-height: 26px;\\\"><span>$project_dir</span></span><br/><span>git pull </span><span style=\\\"color: #d19a66;line-height: 26px;\\\"><span>$repo_url</span></span><br/><br/><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 安装依赖</span></span><br/><span>npm install</span><br/><br/><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 修改配置文件</span></span><br/><span>sed -i </span><span style=\\\"color: #98c379;line-height: 26px;\\\"><span>'s/DATABASE_HOST=localhost/DATABASE_HOST=db.example.com/'</span></span><span> .env</span><br/><br/><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 重启服务</span></span><br/><span>systemctl restart myapp</span><br/><br/><span style=\\\"color: #e6c07b;line-height: 26px;\\\"><span>echo</span></span><span> </span><span style=\\\"color: #98c379;line-height: 26px;\\\"><span>&quot;部署完成！&quot;</span></span><br/></div></pre><h2 style=\\\"margin-top:30px;min-height:32px;line-height:28px;border-bottom:solid 1px #000;color:#773098;display:inline-block;border-bottom-width:1px;border-bottom-style:solid;border-color:#773098;padding-top:5px;padding-right:0.5em;padding-left:0.5em;margin-bottom:-3px;font-size:22px;margin:1em auto;padding:0.5em 0;text-align:center;width:85%;font-weight:bold;display:flex;flex-direction:column;justify-content:center\\\"><span><span>2. 用户管理脚本</span></span><span></span></h2><ul style=\\\"margin:0;margin-top:8px;margin-bottom:8px;padding-left:25px;color:black;list-style-type:disc\\\"><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><strong style=\\\"font-weight: bold;color: #773098;\\\"><span>功能:</span></strong><span> 批量创建、删除、修改用户账号和权限。</span></div></li><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><strong style=\\\"font-weight: bold;color: #773098;\\\"><span>应用场景:</span></strong><span> 简化用户管理流程，提高管理效率。</span></div></li><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><strong style=\\\"font-weight: bold;color: #773098;\\\"><span>示例代码:</span></strong></div></li></ul><pre style=\\\"margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\\\"><span style=\\\"display: block;background: none;height: 30px;width: 100%;background-size: 40px;background-repeat: no-repeat;background-color: #282c34;margin-bottom: -7px;border-radius: 5px;background-position: 10px 10px;background-image: url(&quot;https://mmbiz.qpic.cn/mmbiz_svg/V0mhkIwf3EH1JxUibAagrJ4kvmibgoG2RcFxIn3E4JUMWurHMuCp53tgcQpKeydtzjU1PEbgXsabsmRrcYy7ysRXiaquNnUxF2z/640?wx_fmt=svg&amp;from=appmsg&quot;);\\\"></span><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"color: #61aeee;line-height: 26px;\\\"><span>#!/bin/bash</span><br/></span><br/><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 定义用户列表文件</span></span><br/><span>user_list=</span><span style=\\\"color: #98c379;line-height: 26px;\\\"><span>&quot;user_list.txt&quot;</span></span><br/><br/><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 遍历用户列表文件</span></span><br/><span style=\\\"color: #c678dd;line-height: 26px;\\\"><span>while</span></span><span> </span><span style=\\\"color: #e6c07b;line-height: 26px;\\\"><span>read</span></span><span> -r username password; </span><span style=\\\"color: #c678dd;line-height: 26px;\\\"><span>do</span></span><br/><span>    </span><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 创建用户</span></span><br/><span>    useradd -m -s /bin/bash </span><span style=\\\"color: #d19a66;line-height: 26px;\\\"><span>$username</span></span><br/><br/><span>    </span><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 设置用户密码</span></span><br/><span>    </span><span style=\\\"color: #e6c07b;line-height: 26px;\\\"><span>echo</span></span><span> </span><span style=\\\"color: #98c379;line-height: 26px;\\\"><span>&quot;</span><span style=\\\"color: #d19a66;line-height: 26px;\\\"><span>$username</span></span><span>:</span><span style=\\\"color: #d19a66;line-height: 26px;\\\"><span>$password</span></span><span>&quot;</span></span><span> | chpasswd</span><br/><br/><span>    </span><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 添加用户到sudo组</span></span><br/><span>    usermod -aG sudo </span><span style=\\\"color: #d19a66;line-height: 26px;\\\"><span>$username</span></span><br/><span style=\\\"color: #c678dd;line-height: 26px;\\\"><span>done</span></span><span> &lt; </span><span style=\\\"color: #d19a66;line-height: 26px;\\\"><span>$user_list</span></span><br/><br/><span style=\\\"color: #e6c07b;line-height: 26px;\\\"><span>echo</span></span><span> </span><span style=\\\"color: #98c379;line-height: 26px;\\\"><span>&quot;用户创建完成！&quot;</span></span><br/></div></pre><h2 style=\\\"margin-top:30px;min-height:32px;line-height:28px;border-bottom:solid 1px #000;color:#773098;display:inline-block;border-bottom-width:1px;border-bottom-style:solid;border-color:#773098;padding-top:5px;padding-right:0.5em;padding-left:0.5em;margin-bottom:-3px;font-size:22px;margin:1em auto;padding:0.5em 0;text-align:center;width:85%;font-weight:bold;display:flex;flex-direction:column;justify-content:center\\\"><span><span>3. 软件安装脚本</span></span><span></span></h2><ul style=\\\"margin:0;margin-top:8px;margin-bottom:8px;padding-left:25px;color:black;list-style-type:disc\\\"><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><strong style=\\\"font-weight: bold;color: #773098;\\\"><span>功能:</span></strong><span> 自动化安装和配置软件包。</span></div></li><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><strong style=\\\"font-weight: bold;color: #773098;\\\"><span>应用场景:</span></strong><span> 简化软件安装流程，提高安装效率。</span></div></li><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><strong style=\\\"font-weight: bold;color: #773098;\\\"><span>示例代码:</span></strong></div></li></ul><pre style=\\\"margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\\\"><span style=\\\"display: block;background: none;height: 30px;width: 100%;background-size: 40px;background-repeat: no-repeat;background-color: #282c34;margin-bottom: -7px;border-radius: 5px;background-position: 10px 10px;background-image: url(&quot;https://mmbiz.qpic.cn/mmbiz_svg/V0mhkIwf3EH1JxUibAagrJ4kvmibgoG2RcFxIn3E4JUMWurHMuCp53tgcQpKeydtzjU1PEbgXsabsmRrcYy7ysRXiaquNnUxF2z/640?wx_fmt=svg&amp;from=appmsg&quot;);\\\"></span><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"color: #61aeee;line-height: 26px;\\\"><span>#!/bin/bash</span><br/></span><br/><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 更新软件包列表</span></span><br/><span>apt-get update</span><br/><br/><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 安装软件包</span></span><br/><span>apt-get install -y nginx mysql-server php-fpm</span><br/><br/><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 配置软件包</span></span><br/><span>sed -i </span><span style=\\\"color: #98c379;line-height: 26px;\\\"><span>'s/listen = 127.0.0.1:9000/listen = /var/run/php/php7.4-fpm.sock/'</span></span><span> /etc/php/7.4/fpm/pool.d/www.conf</span><br/><br/><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 启动服务</span></span><br/><span>systemctl start nginx mysql php7.4-fpm</span><br/><br/><span style=\\\"color: #e6c07b;line-height: 26px;\\\"><span>echo</span></span><span> </span><span style=\\\"color: #98c379;line-height: 26px;\\\"><span>&quot;软件安装完成！&quot;</span></span><br/></div></pre><h2 style=\\\"margin-top:30px;min-height:32px;line-height:28px;border-bottom:solid 1px #000;color:#773098;display:inline-block;border-bottom-width:1px;border-bottom-style:solid;border-color:#773098;padding-top:5px;padding-right:0.5em;padding-left:0.5em;margin-bottom:-3px;font-size:22px;margin:1em auto;padding:0.5em 0;text-align:center;width:85%;font-weight:bold;display:flex;flex-direction:column;justify-content:center\\\"><span><span>4. 网络配置脚本</span></span><span></span></h2><ul style=\\\"margin:0;margin-top:8px;margin-bottom:8px;padding-left:25px;color:black;list-style-type:disc\\\"><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><strong style=\\\"font-weight: bold;color: #773098;\\\"><span>功能:</span></strong><span> 配置网络接口、IP地址、路由、防火墙等。</span></div></li><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><strong style=\\\"font-weight: bold;color: #773098;\\\"><span>应用场景:</span></strong><span> 简化网络配置流程，提高配置效率。</span></div></li><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><strong style=\\\"font-weight: bold;color: #773098;\\\"><span>示例代码:</span></strong></div></li></ul><pre style=\\\"margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\\\"><span style=\\\"display: block;background: none;height: 30px;width: 100%;background-size: 40px;background-repeat: no-repeat;background-color: #282c34;margin-bottom: -7px;border-radius: 5px;background-position: 10px 10px;background-image: url(&quot;https://mmbiz.qpic.cn/mmbiz_svg/V0mhkIwf3EH1JxUibAagrJ4kvmibgoG2RcFxIn3E4JUMWurHMuCp53tgcQpKeydtzjU1PEbgXsabsmRrcYy7ysRXiaquNnUxF2z/640?wx_fmt=svg&amp;from=appmsg&quot;);\\\"></span><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"color: #61aeee;line-height: 26px;\\\"><span>#!/bin/bash</span><br/></span><br/><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 配置网络接口</span></span><br/><span>cat &lt;&lt;EOF &gt; /etc/network/interfaces</span><br/><span>auto eth0</span><br/><span>iface eth0 inet static</span><br/><span>    address 192.168.1.100</span><br/><span>    netmask 255.255.255.0</span><br/><span>    gateway 192.168.1.1</span><br/><span>EOF</span><br/><br/><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 重启网络服务</span></span><br/><span>systemctl restart networking</span><br/><br/><span style=\\\"color: #5c6370;font-style: italic;line-height: 26px;\\\"><span># 配置防火墙</span></span><br/><span>ufw allow 22/tcp</span><br/><span>ufw allow 80/tcp</span><br/><span>ufw </span><span style=\\\"color: #e6c07b;line-height: 26px;\\\"><span>enable</span></span><br/><br/><span style=\\\"color: #e6c07b;line-height: 26px;\\\"><span>echo</span></span><span> </span><span style=\\\"color: #98c379;line-height: 26px;\\\"><span>&quot;网络配置完成！&quot;</span></span><br/></div></pre><h2 style=\\\"margin-top:30px;min-height:32px;line-height:28px;border-bottom:solid 1px #000;color:#773098;display:inline-block;border-bottom-width:1px;border-bottom-style:solid;border-color:#773098;padding-top:5px;padding-right:0.5em;padding-left:0.5em;margin-bottom:-3px;font-size:22px;margin:1em auto;padding:0.5em 0;text-align:center;width:85%;font-weight:bold;display:flex;flex-direction:column;justify-content:center\\\"><span><span>总结</span></span><span></span></h2><ol style=\\\"margin:0;margin-top:8px;margin-bottom:8px;padding-left:25px;color:black;list-style-type:decimal\\\"><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><span>自动化部署脚本：自动化部署应用程序，提高部署效率。</span></div></li><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><span>用户管理脚本：批量创建、删除、修改用户账号和权限。</span></div></li><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><span>软件安装脚本：自动化安装和配置软件包，简化安装流程。</span></div></li><li><div style=\\\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;\\\"><span>网络配置脚本：配置网络接口、IP地址、路由、防火墙等，简化网络配置流程。</span></div></li></ol><p style=\\\"font-size:16px;padding-top:8px;padding-bottom:8px;line-height:26px;color:black;margin:1em 4px\\\"><span>通过使用这些脚本，可以大大提高运维效率，减少人工操作的错误和时间成本。</span></p><p style=\\\"font-size:16px;padding-top:8px;padding-bottom:8px;line-height:26px;color:black;margin:1em 4px\\\"><span>– 欢迎点赞、关注、转发、收藏【我码玄黄】，各大平台同名。</span></p></div><div><span><br/></span></div></div></div><div><div><div><div style=\\\"display:flex;color:rgba(0,0,0,.3);\\\"><div style=\\\"color:rgba(0,0,0,.3);\\\">个人观点，仅供参考</div></div></div></div></div></div></div></div></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":20876}]"
metadata_diff: {"new":{"id":"1c18826d76ba46849ef8bc54e038fffd","parent_id":"f67288c3a0be4374b5d532b5dcc3aabc","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764348869402,"user_updated_time":1764345625240,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":1764365027525},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T21:24:55.975Z
created_time: 2025-11-28T21:24:55.975Z
type_: 13