{"id":30779,"date":"2025-04-21T03:36:02","date_gmt":"2025-04-20T19:36:02","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/30779.html"},"modified":"2025-04-21T03:36:02","modified_gmt":"2025-04-20T19:36:02","slug":"%e5%a6%82%e4%bd%95%e8%bf%81%e7%a7%bb-linux-%e6%9c%8d%e5%8a%a1%e5%99%a8-%e7%ac%ac%e4%b8%80%e9%83%a8%e5%88%86-%e7%b3%bb%e7%bb%9f%e5%87%86%e5%a4%87","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/30779.html","title":{"rendered":"\u5982\u4f55\u8fc1\u79fb Linux \u670d\u52a1\u5668 \u7b2c\u4e00\u90e8\u5206 - \u7cfb\u7edf\u51c6\u5907"},"content":{"rendered":"<p>\u524d\u4e9b\u5929\u53d1\u73b0\u4e86\u4e00\u4e2a\u5de8\u725b\u7684\u4eba\u5de5\u667a\u80fd\u5b66\u4e60\u7f51\u7ad9&#xff0c;\u901a\u4fd7\u6613\u61c2&#xff0c;\u98ce\u8da3\u5e7d\u9ed8&#xff0c;\u5fcd\u4e0d\u4f4f\u5206\u4eab\u4e00\u4e0b\u7ed9\u5927\u5bb6\u3002\u70b9\u51fb\u8df3\u8f6c\u5230\u7f51\u7ad9\u3002<\/p>\n<h4>\u7b80\u4ecb<\/h4>\n<p>\u5728\u8bb8\u591a\u60c5\u51b5\u4e0b&#xff0c;\u60a8\u53ef\u80fd\u9700\u8981\u5c06\u6570\u636e\u548c\u64cd\u4f5c\u9700\u6c42\u4ece\u4e00\u4e2a\u670d\u52a1\u5668\u8fc1\u79fb\u5230\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u3002\u60a8\u53ef\u80fd\u9700\u8981\u5728\u65b0\u7684\u6570\u636e\u4e2d\u5fc3\u5b9e\u65bd\u89e3\u51b3\u65b9\u6848&#xff0c;\u5347\u7ea7\u5230\u66f4\u5927\u7684\u673a\u5668&#xff0c;\u6216\u8005\u8fc7\u6e21\u5230\u65b0\u7684\u786c\u4ef6\u6216\u65b0\u7684 VPS \u63d0\u4f9b\u5546\u3002<\/p>\n<p>\u65e0\u8bba\u60a8\u7684\u539f\u56e0\u662f\u4ec0\u4e48&#xff0c;\u5728\u4ece\u4e00\u4e2a\u7cfb\u7edf\u8fc1\u79fb\u5230\u53e6\u4e00\u4e2a\u7cfb\u7edf\u65f6&#xff0c;\u60a8\u5e94\u8be5\u8003\u8651\u8bb8\u591a\u4e0d\u540c\u7684\u56e0\u7d20\u3002\u5982\u679c\u60a8\u6ca1\u6709\u4f7f\u7528 Chef\u3001Puppet \u6216 Ansible \u7b49\u914d\u7f6e\u7ba1\u7406\u89e3\u51b3\u65b9\u6848&#xff0c;\u8981\u83b7\u5f97\u529f\u80fd\u4e0a\u7b49\u6548\u7684\u914d\u7f6e\u53ef\u80fd\u4f1a\u5f88\u56f0\u96be\u3002\u60a8\u4e0d\u4ec5\u9700\u8981\u4f20\u8f93\u6570\u636e&#xff0c;\u8fd8\u9700\u8981\u914d\u7f6e\u60a8\u7684\u670d\u52a1\u5728\u65b0\u673a\u5668\u4e0a\u4ee5\u76f8\u540c\u7684\u65b9\u5f0f\u8fd0\u884c\u3002<\/p>\n<p>\u5728\u672c\u6307\u5357\u4e2d&#xff0c;\u60a8\u5c06\u4e86\u89e3\u5982\u4f55\u51c6\u5907\u6e90\u7cfb\u7edf\u548c\u76ee\u6807\u7cfb\u7edf\u8fdb\u884c\u8fc1\u79fb\u3002\u8fd9\u5c06\u5305\u62ec\u8ba9\u60a8\u7684\u4e24\u53f0\u673a\u5668\u4f7f\u7528 SSH \u5bc6\u94a5\u8fdb\u884c\u901a\u4fe1&#xff0c;\u5e76\u8c03\u67e5\u9700\u8981\u8f6c\u79fb\u7684\u7ec4\u4ef6\u3002\u60a8\u5c06\u5728\u672c\u7cfb\u5217\u7684\u4e0b\u4e00\u7bc7\u6587\u7ae0\u4e2d\u5f00\u59cb\u5b9e\u9645\u8fc1\u79fb\u3002<\/p>\n<h3>\u6b65\u9aa4 1 \u2013 \u521b\u5efa\u5907\u4efd<\/h3>\n<p>\u6267\u884c\u4efb\u4f55\u53ef\u80fd\u5177\u6709\u7834\u574f\u6027\u7684\u64cd\u4f5c\u65f6&#xff0c;\u9996\u5148\u8981\u91c7\u53d6\u7684\u6b65\u9aa4\u662f\u521b\u5efa\u5168\u65b0\u7684\u5907\u4efd\u3002\u60a8\u4e0d\u5e0c\u671b\u5728\u66ff\u6362\u6b63\u5728\u8fd0\u884c\u7684\u751f\u4ea7\u673a\u5668\u4e4b\u524d&#xff0c;\u67d0\u4e2a\u547d\u4ee4\u5728\u5f53\u524d\u751f\u4ea7\u673a\u5668\u4e0a\u51fa\u73b0\u6545\u969c\u3002<\/p>\n<p>\u6709\u8bb8\u591a\u4e0d\u540c\u7684\u65b9\u6cd5\u53ef\u4ee5\u5907\u4efd\u670d\u52a1\u5668\u3002\u60a8\u7684\u9009\u62e9\u5c06\u53d6\u51b3\u4e8e\u5bf9\u60a8\u7684\u60c5\u51b5\u6709\u610f\u4e49\u7684\u9009\u9879\u4ee5\u53ca\u60a8\u6700\u719f\u6089\u7684\u9009\u9879\u3002<\/p>\n<p>\u5982\u679c\u60a8\u53ef\u4ee5\u8bbf\u95ee\u7269\u7406\u786c\u4ef6\u5e76\u6709\u5907\u4efd\u7a7a\u95f4&#xff08;\u78c1\u76d8\u9a71\u52a8\u5668\u3001USB \u7b49&#xff09;&#xff0c;\u60a8\u53ef\u4ee5\u4f7f\u7528\u8bb8\u591a\u53ef\u7528\u7684\u955c\u50cf\u5907\u4efd\u89e3\u51b3\u65b9\u6848\u4e4b\u4e00\u6765\u514b\u9686\u78c1\u76d8\u3002\u5728\u5904\u7406\u4e91\u670d\u52a1\u5668\u65f6&#xff0c;\u529f\u80fd\u4e0a\u7b49\u6548\u7684\u65b9\u6cd5\u662f\u5728\u63a7\u5236\u9762\u677f\u754c\u9762\u5185\u62cd\u6444\u5feb\u7167\u6216\u955c\u50cf\u3002<\/p>\n<p>\u5b8c\u6210\u5907\u4efd\u540e&#xff0c;\u60a8\u5c31\u53ef\u4ee5\u7ee7\u7eed\u8fdb\u884c\u4e0b\u4e00\u6b65\u4e86\u3002\u5728\u672c\u6307\u5357\u7684\u5176\u4f59\u90e8\u5206&#xff0c;\u60a8\u5c06\u9700\u8981\u4ee5 root \u7528\u6237\u8eab\u4efd\u8fd0\u884c\u8bb8\u591a\u547d\u4ee4&#xff0c;\u6216\u8005\u4f7f\u7528 sudo\u3002<\/p>\n<h3>\u6b65\u9aa4 2 \u2013 \u6536\u96c6\u6709\u5173\u6e90\u7cfb\u7edf\u7684\u4fe1\u606f<\/h3>\n<p>\u5728\u5f00\u59cb\u8fc1\u79fb\u4e4b\u524d&#xff0c;\u60a8\u5e94\u8be5\u914d\u7f6e\u76ee\u6807\u7cfb\u7edf\u4ee5\u5339\u914d\u6e90\u7cfb\u7edf\u3002<\/p>\n<p>\u60a8\u5c06\u5e0c\u671b\u5728\u5f53\u524d\u670d\u52a1\u5668\u548c\u8ba1\u5212\u8fc1\u79fb\u5230\u7684\u670d\u52a1\u5668\u4e4b\u95f4\u5c3d\u53ef\u80fd\u5339\u914d\u3002\u60a8\u53ef\u80fd\u5e0c\u671b\u5728\u8fc1\u79fb\u5230\u8f83\u65b0\u7684\u76ee\u6807\u7cfb\u7edf\u4e4b\u524d\u5347\u7ea7\u5f53\u524d\u670d\u52a1\u5668&#xff0c;\u5e76\u5728\u6b64\u4e4b\u540e\u518d\u6b21\u8fdb\u884c\u5907\u4efd\u3002\u91cd\u8981\u7684\u662f&#xff0c;\u5f53\u5f00\u59cb\u5b9e\u9645\u8fc1\u79fb\u65f6&#xff0c;\u5b83\u4eec\u5c3d\u53ef\u80fd\u5339\u914d\u3002<\/p>\n<p>\u5927\u90e8\u5206\u53ef\u4ee5\u5e2e\u52a9\u60a8\u51b3\u5b9a\u4e3a\u65b0\u673a\u5668\u521b\u5efa\u54ea\u79cd\u670d\u52a1\u5668\u7cfb\u7edf\u7684\u4fe1\u606f\u53ef\u4ee5\u4f7f\u7528 uname \u547d\u4ee4\u68c0\u7d22&#xff1a;<\/p>\n<p>uname -r<\/p>\n<p>5.4.0-26-generic<\/p>\n<p>\u8fd9\u662f\u60a8\u5f53\u524d\u7cfb\u7edf\u6b63\u5728\u8fd0\u884c\u7684\u5185\u6838\u7248\u672c\u3002\u4e3a\u4e86\u4f7f\u4e8b\u60c5\u987a\u5229\u8fdb\u884c&#xff0c;\u6700\u597d\u5c1d\u8bd5\u5728\u76ee\u6807\u7cfb\u7edf\u4e0a\u5339\u914d\u5b83\u3002<\/p>\n<p>\u60a8\u8fd8\u5e94\u8be5\u5c1d\u8bd5\u5339\u914d\u6e90\u670d\u52a1\u5668\u7684\u53d1\u884c\u7248\u548c\u7248\u672c\u3002\u5982\u679c\u60a8\u4e0d\u77e5\u9053\u5728\u6e90\u673a\u5668\u4e0a\u5b89\u88c5\u7684\u53d1\u884c\u7248\u7248\u672c&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u67e5\u627e&#xff1a;<\/p>\n<p>cat \/etc\/issue<\/p>\n<p>Ubuntu 20.04.3 LTS \\\\n \\\\l<\/p>\n<p>\u5982\u679c\u53ef\u80fd\u7684\u8bdd&#xff0c;\u60a8\u5e94\u8be5\u4f7f\u7528\u76f8\u540c\u7684\u53c2\u6570\u521b\u5efa\u65b0\u670d\u52a1\u5668\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b&#xff0c;\u60a8\u5c06\u521b\u5efa\u4e00\u4e2a Ubuntu 20.04 \u7cfb\u7edf\u3002\u60a8\u8fd8\u5e94\u5c3d\u91cf\u5339\u914d\u5185\u6838\u7248\u672c\u3002\u901a\u5e38\u60c5\u51b5\u4e0b&#xff0c;\u8fd9\u5e94\u8be5\u662f\u6765\u81ea\u60a8\u7684 Linux \u53d1\u884c\u7248\u5b58\u50a8\u5e93\u7684\u6700\u65b0\u5185\u6838\u3002<\/p>\n<h3>\u6b65\u9aa4 3 \u2013 \u5728\u6e90\u548c\u76ee\u6807\u670d\u52a1\u5668\u4e4b\u95f4\u8bbe\u7f6e SSH \u5bc6\u94a5\u8bbf\u95ee<\/h3>\n<p>\u60a8\u9700\u8981\u8ba9\u60a8\u7684\u670d\u52a1\u5668\u80fd\u591f\u901a\u4fe1\u4ee5\u4fbf\u4f20\u8f93\u6587\u4ef6\u3002\u4e3a\u4e86\u505a\u5230\u8fd9\u4e00\u70b9&#xff0c;\u60a8\u5e94\u8be5\u5728\u5b83\u4eec\u4e4b\u95f4\u4ea4\u6362 SSH \u5bc6\u94a5\u3002\u60a8\u53ef\u4ee5\u5b66\u4e60\u5982\u4f55\u5728 Linux \u670d\u52a1\u5668\u4e0a\u914d\u7f6e SSH \u5bc6\u94a5\u3002<\/p>\n<p>\u60a8\u9700\u8981\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u4e00\u4e2a\u65b0\u5bc6\u94a5&#xff0c;\u4ee5\u4fbf\u5c06\u5176\u6dfb\u52a0\u5230\u73b0\u6709\u670d\u52a1\u5668\u7684 authorized_keys \u6587\u4ef6\u4e2d\u3002\u8fd9\u6bd4\u53e6\u4e00\u79cd\u65b9\u5f0f\u66f4\u6e05\u6670&#xff0c;\u56e0\u4e3a\u8fd9\u6837&#xff0c;\u5f53\u8fc1\u79fb\u5b8c\u6210\u65f6&#xff0c;\u65b0\u670d\u52a1\u5668\u7684 authorized_keys \u6587\u4ef6\u4e2d\u5c31\u4e0d\u4f1a\u6709\u591a\u4f59\u7684\u5bc6\u94a5\u3002<\/p>\n<p>\u9996\u5148&#xff0c;\u5728\u76ee\u6807\u673a\u5668\u4e0a&#xff0c;\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u60a8\u7684 root \u7528\u6237\u662f\u5426\u5df2\u7ecf\u62e5\u6709 SSH \u5bc6\u94a5&#xff1a;<\/p>\n<p>ls ~\/.ssh<\/p>\n<p>authorized_keys<\/p>\n<p>\u5982\u679c\u60a8\u770b\u5230\u540d\u4e3a id_rsa.pub \u548c id_rsa \u7684\u6587\u4ef6&#xff0c;\u5219\u8868\u793a\u60a8\u5df2\u7ecf\u62e5\u6709\u5bc6\u94a5&#xff0c;\u60a8\u53ea\u9700\u8981\u5c06\u5b83\u4eec\u4f20\u8f93\u8fc7\u53bb\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6ca1\u6709\u770b\u5230\u8fd9\u4e9b\u6587\u4ef6&#xff0c;\u53ef\u4ee5\u4f7f\u7528 ssh-keygen \u521b\u5efa\u65b0\u7684\u5bc6\u94a5\u5bf9&#xff1a;<\/p>\n<p>ssh-keygen -t rsa<\/p>\n<p>\u6309\u7167\u63d0\u793a\u6309\u4e0b \u201cEnter\u201d \u952e\u4ee5\u63a5\u53d7\u9ed8\u8ba4\u503c\u3002<\/p>\n<p>\u73b0\u5728&#xff0c;\u60a8\u53ef\u4ee5\u901a\u8fc7 ssh \u5c06\u5bc6\u94a5\u4f20\u8f93\u5230\u6e90\u670d\u52a1\u5668&#xff1a;<\/p>\n<p>cat ~\/.ssh\/id_rsa.pub | ssh other_server_ip &#034;cat &gt;&gt; ~\/.ssh\/authorized_keys&#034;<\/p>\n<p>\u73b0\u5728&#xff0c;\u60a8\u5e94\u8be5\u80fd\u591f\u5728\u76ee\u6807\u7cfb\u7edf\u4e0a\u81ea\u7531\u5730\u901a\u8fc7 SSH \u8fde\u63a5\u5230\u6e90\u670d\u52a1\u5668&#xff0c;\u800c\u65e0\u9700\u63d0\u4f9b\u5bc6\u7801&#xff1a;<\/p>\n<p>ssh other_server_ip<\/p>\n<p>\u8fd9\u5c06\u4f7f\u4efb\u4f55\u8fdb\u4e00\u6b65\u7684\u8fc1\u79fb\u6b65\u9aa4\u66f4\u52a0\u987a\u5229\u3002<\/p>\n<h3>\u6b65\u9aa4 4 \u2013 \u521b\u5efa\u9700\u6c42\u6e05\u5355<\/h3>\n<p>\u73b0\u5728\u4f60\u5c06\u8fdb\u884c\u7cfb\u7edf\u7684\u6df1\u5165\u5206\u6790\u3002<\/p>\n<p>\u5728\u8fd0\u8425\u8fc7\u7a0b\u4e2d&#xff0c;\u4f60\u7684\u8f6f\u4ef6\u9700\u6c42\u53ef\u80fd\u4f1a\u53d1\u751f\u53d8\u5316\u3002\u6709\u65f6\u65e7\u670d\u52a1\u5668\u4e0a\u53ef\u80fd\u5b58\u5728\u4e00\u4e9b\u66fe\u7ecf\u9700\u8981\u7684\u670d\u52a1\u548c\u8f6f\u4ef6&#xff0c;\u4f46\u5df2\u7ecf\u88ab\u66ff\u6362\u3002<\/p>\n<p>\u4e00\u822c\u6765\u8bf4&#xff0c;\u4e0d\u9700\u8981\u7684\u670d\u52a1\u53ef\u4ee5\u88ab\u7981\u7528&#xff0c;\u5982\u679c\u5b8c\u5168\u4e0d\u9700\u8981&#xff0c;\u4e5f\u53ef\u4ee5\u88ab\u5378\u8f7d&#xff0c;\u4f46\u662f\u6e05\u70b9\u5b83\u4eec\u53ef\u80fd\u4f1a\u8017\u8d39\u65f6\u95f4\u3002\u4f60\u9700\u8981\u53d1\u73b0\u5728\u6e90\u670d\u52a1\u5668\u4e0a\u6b63\u5728\u4f7f\u7528\u7684\u670d\u52a1&#xff0c;\u7136\u540e\u51b3\u5b9a\u8fd9\u4e9b\u670d\u52a1\u662f\u5426\u5e94\u8be5\u5b58\u5728\u4e8e\u65b0\u670d\u52a1\u5668\u4e0a\u3002<\/p>\n<p>\u4f60\u53d1\u73b0\u670d\u52a1\u548c\u8fd0\u884c\u7ea7\u522b\u7684\u65b9\u5f0f\u53d6\u51b3\u4e8e\u670d\u52a1\u5668\u6240\u91c7\u7528\u7684\u201cinit\u201d\u7cfb\u7edf\u7684\u7c7b\u578b\u3002init \u7cfb\u7edf\u8d1f\u8d23\u5728\u7528\u6237\u547d\u4ee4\u6216\u81ea\u52a8\u542f\u52a8\u548c\u505c\u6b62\u670d\u52a1\u3002\u4ece 2014 \u5e74\u5f00\u59cb&#xff0c;\u51e0\u4e4e\u6240\u6709\u4e3b\u8981\u7684 Linux \u53d1\u884c\u7248\u90fd\u91c7\u7528\u4e86\u4e00\u4e2a\u540d\u4e3a Systemd \u7684 init \u7cfb\u7edf&#xff0c;\u672c\u6307\u5357\u5c06\u53cd\u6620 Systemd\u3002<\/p>\n<p>\u4e3a\u4e86\u5217\u51fa\u5df2\u6ce8\u518c\u5230 Systemd \u7684\u670d\u52a1&#xff0c;\u4f60\u53ef\u4ee5\u4f7f\u7528 systemctl \u547d\u4ee4&#xff1a;<\/p>\n<p>systemctl list-units -t service<\/p>\n<p>  UNIT                                 LOAD   ACTIVE SUB     DESCRIPTION               &gt;<br \/>\n  accounts-daemon.service              loaded active running Accounts Service          &gt;<br \/>\n  apparmor.service                     loaded active exited  Load AppArmor profiles    &gt;<br \/>\n  apport.service                       loaded active exited  LSB: automatic crash repor&gt;<br \/>\n  atd.service                          loaded active running Deferred execution schedul&gt;<br \/>\n  blk-availability.service             loaded active exited  Availability of block devi&gt;<br \/>\n  cloud-config.service                 loaded active exited  Apply the settings specifi&gt;<br \/>\n  cloud-final.service                  loaded active exited  Execute cloud user\/final s&gt;<br \/>\n  cloud-init-local.service             loaded active exited  Initial cloud-init job (pr&gt;<br \/>\n  cloud-init.service                   loaded active exited  Initial cloud-init job (me&gt;<br \/>\n  console-setup.service                loaded active exited  Set console font and keyma&gt;<br \/>\n  containerd.service                   loaded active running containerd container runti&gt;<br \/>\n\u2026<\/p>\n<p>Systemd \u901a\u8fc7\u201ctargets\u201d\u5b9e\u73b0\u670d\u52a1\u7ba1\u7406\u3002\u4f20\u7edf init \u7cfb\u7edf\u7684\u7cfb\u7edf\u4e00\u6b21\u53ea\u80fd\u5904\u4e8e\u4e00\u4e2a\u201c\u8fd0\u884c\u7ea7\u522b\u201d&#xff0c;\u800c\u4f7f\u7528 Systemd \u7684\u670d\u52a1\u5668\u53ef\u4ee5\u540c\u65f6\u8fbe\u5230\u591a\u4e2a targets\u3002\u8fd9\u5728\u5b9e\u8df5\u4e2d\u66f4\u52a0\u7075\u6d3b&#xff0c;\u4f46\u786e\u5b9a\u54ea\u4e9b\u670d\u52a1\u662f\u6d3b\u52a8\u7684\u53ef\u80fd\u66f4\u52a0\u56f0\u96be\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u67e5\u770b\u5f53\u524d\u6d3b\u52a8\u7684 targets&#xff1a;<\/p>\n<p>systemctl list-units -t target<\/p>\n<p>  UNIT                   LOAD   ACTIVE SUB    DESCRIPTION<br \/>\n  basic.target           loaded active active Basic System<br \/>\n  cloud-config.target    loaded active active Cloud-config availability<br \/>\n  cloud-init.target      loaded active active Cloud-init target<br \/>\n  cryptsetup.target      loaded active active Local Encrypted Volumes<br \/>\n  getty.target           loaded active active Login Prompts<br \/>\n  graphical.target       loaded active active Graphical Interface<br \/>\n  local-fs-pre.target    loaded active active Local File Systems (Pre)<br \/>\n  local-fs.target        loaded active active Local File Systems<br \/>\n  multi-user.target      loaded active active Multi-User System<br \/>\n  network-online.target  loaded active active Network is Online<br \/>\n\u2026<\/p>\n<p>\u4f60\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5217\u51fa\u6240\u6709\u53ef\u7528\u7684 targets&#xff1a;<\/p>\n<p>systemctl list-unit-files -t target<\/p>\n<p>UNIT FILE                     STATE           VENDOR PRESET<br \/>\nbasic.target                  static          enabled<br \/>\nblockdev&#064;.target              static          enabled<br \/>\nbluetooth.target              static          enabled<br \/>\nboot-complete.target          static          enabled<br \/>\ncloud-config.target           static          enabled<br \/>\ncloud-init.target             enabled-runtime enabled<br \/>\ncryptsetup-pre.target         static          disabled<br \/>\ncryptsetup.target             static          enabled<br \/>\nctrl-alt-del.target           disabled        enabled<br \/>\n\u2026<\/p>\n<p>\u4ece\u8fd9\u91cc&#xff0c;\u4f60\u53ef\u4ee5\u627e\u51fa\u6bcf\u4e2a target \u5173\u8054\u7684\u670d\u52a1\u3002Targets \u53ef\u4ee5\u6709\u670d\u52a1\u6216\u5176\u4ed6 targets \u4f5c\u4e3a\u4f9d\u8d56\u9879&#xff0c;\u56e0\u6b64\u4f60\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u67e5\u770b\u6bcf\u4e2a target \u5b9e\u65bd\u7684\u7b56\u7565&#xff1a;<\/p>\n<p>systemctl list-dependencies target_name.target<\/p>\n<p>multi-user.target \u662f Systemd \u670d\u52a1\u5668\u4e0a\u5e38\u7528\u7684\u4e00\u4e2a target&#xff0c;\u5728\u542f\u52a8\u8fc7\u7a0b\u4e2d\u8fbe\u5230\u8be5\u76ee\u6807\u65f6&#xff0c;\u7528\u6237\u53ef\u4ee5\u767b\u5f55\u3002\u4f8b\u5982&#xff0c;\u4f60\u53ef\u4ee5\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<p>systemctl list-dependencies multi-user.target<\/p>\n<p>multi-user.target<br \/>\n\u25cf \u251c\u2500apport.service<br \/>\n\u25cf \u251c\u2500atd.service<br \/>\n\u25cf \u251c\u2500console-setup.service<br \/>\n\u25cf \u251c\u2500containerd.service<br \/>\n\u25cf \u251c\u2500cron.service<br \/>\n\u25cf \u251c\u2500dbus.service<br \/>\n\u25cf \u251c\u2500dmesg.service<br \/>\n\u25cf \u251c\u2500docker.service<br \/>\n\u25cf \u251c\u2500grub-common.service<br \/>\n\u25cf \u251c\u2500grub-initrd-fallback.service<br \/>\n\u2026<\/p>\n<p>\u8fd9\u5c06\u5217\u51fa\u8be5\u76ee\u6807\u7684\u4f9d\u8d56\u6811&#xff0c;\u7ed9\u51fa\u5f53\u8fbe\u5230\u8be5\u76ee\u6807\u65f6\u542f\u52a8\u7684\u670d\u52a1\u548c\u5176\u4ed6 targets \u7684\u5217\u8868\u3002<\/p>\n<h4>\u901a\u8fc7\u5176\u4ed6\u65b9\u6cd5\u68c0\u67e5\u670d\u52a1<\/h4>\n<p>\u867d\u7136\u5927\u591a\u6570\u7531\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u914d\u7f6e\u7684\u670d\u52a1\u5c06\u88ab\u6ce8\u518c\u5230 init \u7cfb\u7edf\u4e2d&#xff0c;\u4f46\u4e00\u4e9b\u5176\u4ed6\u8f6f\u4ef6&#xff0c;\u5982 Docker \u90e8\u7f72&#xff0c;\u53ef\u80fd\u4e0d\u4f1a\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u5c1d\u8bd5\u901a\u8fc7\u67e5\u770b\u8fd9\u4e9b\u670d\u52a1\u4f7f\u7528\u7684\u7f51\u7edc\u7aef\u53e3\u548c Unix \u5957\u63a5\u5b57\u6765\u627e\u5230\u8fd9\u4e9b\u5176\u4ed6\u670d\u52a1\u548c\u8fdb\u7a0b\u3002\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b&#xff0c;\u670d\u52a1\u4ee5\u67d0\u79cd\u65b9\u5f0f\u76f8\u4e92\u901a\u4fe1\u6216\u4e0e\u5916\u90e8\u5b9e\u4f53\u901a\u4fe1\u3002\u670d\u52a1\u5668\u4e0a\u53ea\u6709\u4e00\u5b9a\u6570\u91cf\u7684\u63a5\u53e3\u53ef\u4ee5\u7528\u4e8e\u670d\u52a1\u901a\u4fe1&#xff0c;\u68c0\u67e5\u8fd9\u4e9b\u63a5\u53e3\u662f\u53d1\u73b0\u5176\u4ed6\u670d\u52a1\u7684\u597d\u65b9\u6cd5\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u4f7f\u7528 netstat \u5de5\u5177\u6765\u53d1\u73b0\u6b63\u5728\u4f7f\u7528\u7684\u7f51\u7edc\u7aef\u53e3\u548c Unix \u5957\u63a5\u5b57\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528 -nlp \u6807\u5fd7\u8fd0\u884c netstat \u4ee5\u83b7\u5f97\u6982\u8ff0&#xff1a;<\/p>\n<p>netstat -nlp<\/p>\n<ul>\n<li>-n \u6307\u5b9a\u8f93\u51fa\u4e2d\u5e94\u663e\u793a\u6570\u5b57 IP \u5730\u5740&#xff0c;\u800c\u4e0d\u662f\u4e3b\u673a\u540d\u6216\u7528\u6237\u540d\u3002\u5728\u68c0\u67e5\u672c\u5730\u670d\u52a1\u5668\u65f6&#xff0c;\u8fd9\u901a\u5e38\u66f4\u52a0\u4fe1\u606f\u4e30\u5bcc\u3002<\/li>\n<li>-l \u6307\u5b9a netstat \u53ea\u663e\u793a\u6d3b\u52a8\u76d1\u542c\u5957\u63a5\u5b57\u3002<\/li>\n<li>-p \u663e\u793a\u6bcf\u4e2a\u4f7f\u7528\u7aef\u53e3\u6216\u5957\u63a5\u5b57\u7684\u8fdb\u7a0b ID&#xff08;PID&#xff09;\u548c\u540d\u79f0\u3002<\/li>\n<\/ul>\n<p>Active Internet connections (only servers)<br \/>\nProto Recv-Q Send-Q Local Address           Foreign Address         State       PID\/Program name<br \/>\ntcp        0      0 0.0.0.0:8200            0.0.0.0:*               LISTEN      104207\/vault<br \/>\ntcp        0      0 0.0.0.0:1935            0.0.0.0:*               LISTEN      3691671\/nginx: mast<br \/>\ntcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      3691671\/nginx: mast<br \/>\ntcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      3691671\/nginx: mast<br \/>\ntcp        0      0 0.0.0.0:1936            0.0.0.0:*               LISTEN      197885\/stunnel4<br \/>\ntcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      162540\/systemd-reso<br \/>\ntcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      129518\/sshd: \/usr\/s<br \/>\ntcp        0      0 127.0.0.1:3000          0.0.0.0:*               LISTEN      99465\/node \/root\/he<br \/>\ntcp        0      0 0.0.0.0:8088            0.0.0.0:*               LISTEN      3691671\/nginx: mast<br \/>\ntcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      3691671\/nginx: mast<br \/>\ntcp        0      0 0.0.0.0:56733           0.0.0.0:*               LISTEN      170269\/docker-proxy<br \/>\ntcp6       0      0 :::80                   :::*                    LISTEN      3691671\/nginx: mast<br \/>\ntcp6       0      0 :::22                   :::*                    LISTEN      129518\/sshd: \/usr\/s<br \/>\ntcp6       0      0 :::443                  :::*                    LISTEN      3691671\/nginx: mast<br \/>\ntcp6       0      0 :::56733                :::*                    LISTEN      170275\/docker-proxy<br \/>\nudp        0      0 127.0.0.53:53           0.0.0.0:*                           162540\/systemd-reso<br \/>\nraw6       0      0 :::58                   :::*                    7           162524\/systemd-netw<br \/>\nraw6       0      0 :::58                   :::*                    7           162524\/systemd-netw<br \/>\nActive UNIX domain sockets (only servers)<br \/>\nProto RefCnt Flags       Type       State         I-Node   PID\/Program name     Path<br \/>\nunix  2      [ ACC ]     STREAM     LISTENING     5313074  1\/systemd            \/run\/systemd\/userdb\/io.systemd.DynamicUser<br \/>\nunix  2      [ ACC ]     SEQPACKET  LISTENING     12985    1\/systemd            \/run\/udev\/control<br \/>\nunix  2      [ ACC ]     STREAM     LISTENING     12967    1\/systemd            \/run\/lvm\/lvmpolld.socket<br \/>\nunix  2      [ ACC ]     STREAM     LISTENING     12980    1\/systemd            \/run\/systemd\/journal\/stdout<br \/>\nunix  2      [ ACC ]     STREAM     LISTENING     16037236 95187\/systemd        \/run\/user\/0\/systemd\/private<br \/>\n\u2026<\/p>\n<p>netstat \u8f93\u51fa\u5305\u542b\u4e24\u4e2a\u72ec\u7acb\u7684\u5757 \u2014\u2014 \u4e00\u4e2a\u7528\u4e8e\u7f51\u7edc\u7aef\u53e3&#xff0c;\u4e00\u4e2a\u7528\u4e8e\u5957\u63a5\u5b57\u3002\u5982\u679c\u4f60\u5728\u8fd9\u91cc\u770b\u5230\u4e86\u901a\u8fc7 init \u7cfb\u7edf\u6ca1\u6709\u4fe1\u606f\u7684\u670d\u52a1&#xff0c;\u4f60\u5c06\u4e0d\u5f97\u4e0d\u5f04\u6e05\u695a\u539f\u56e0&#xff0c;\u5e76\u786e\u5b9a\u662f\u5426\u6253\u7b97\u8fc1\u79fb\u8fd9\u4e9b\u670d\u52a1\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u4f7f\u7528 lsof \u547d\u4ee4\u83b7\u53d6\u5173\u4e8e\u670d\u52a1\u63d0\u4f9b\u7684\u7aef\u53e3\u7684\u7c7b\u4f3c\u4fe1\u606f&#xff1a;<\/p>\n<p>lsof<\/p>\n<p>COMMAND       PID            USER   FD   TYPE   DEVICE SIZE\/OFF NODE NAME<br \/>\nnode\\\\x20\/   99465            root   20u  IPv4 16046039      0t0  TCP 127.0.0.1:3000 (LISTEN)<br \/>\nvault      104207           vault    8u  IPv4  1134285      0t0  TCP *:8200 (LISTEN)<br \/>\nsshd       129518            root    3u  IPv4  1397496      0t0  TCP *:22 (LISTEN)<br \/>\nsshd       129518            root    4u  IPv6  1397507      0t0  TCP *:22 (LISTEN)<br \/>\nsystemd-r  162540 systemd-resolve   12u  IPv4  5313507      0t0  UDP 127.0.0.53:53<br \/>\nsystemd-r  162540 systemd-resolve   13u  IPv4  5313508      0t0  TCP 127.0.0.53:53 (LISTEN)<br \/>\ndocker-pr  170269            root    4u  IPv4  1700561      0t0  TCP *:56733 (LISTEN)<br \/>\ndocker-pr  170275            root    4u  IPv6  1700573      0t0  TCP *:56733 (LISTEN)<br \/>\nstunnel4   197885        stunnel4    9u  IPv4  1917328      0t0  TCP *:1936 (LISTEN)<br \/>\nsshd      3469804            root    4u  IPv4 22246413      0t0  TCP 159.203.102.125:22-&gt;154.5.29.188:36756 (ESTABLISHED)<br \/>\nnginx     3691671            root    7u  IPv4  2579911      0t0  TCP *:8080 (LISTEN)<br \/>\nnginx     3691671            root    8u  IPv4  1921506      0t0  TCP *:80 (LISTEN)<br \/>\nnginx     3691671            root    9u  IPv6  1921507      0t0  TCP *:80 (LISTEN)<br \/>\nnginx     3691671            root   10u  IPv6  1921508      0t0  TCP *:443 (LISTEN)<br \/>\nnginx     3691671            root   11u  IPv4  1921509      0t0  TCP *:443 (LISTEN)<br \/>\nnginx     3691671            root   12u  IPv4  2579912      0t0  TCP *:8088 (LISTEN)<br \/>\nnginx     3691671            root   13u  IPv4  2579913      0t0  TCP *:1935 (LISTEN)<br \/>\nnginx     3691674        www-data    7u  IPv4  2579911      0t0  TCP *:8080 (LISTEN)<br \/>\nnginx     3691674        www-data    8u  IPv4  1921506      0t0  TCP *:80 (LISTEN)<br \/>\nnginx     3691674        www-data    9u  IPv6  1921507      0t0  TCP *:80 (LISTEN)<br \/>\nnginx     3691674        www-data   10u  IPv6  1921508      0t0  TCP *:443 (LISTEN)<br \/>\nnginx     3691674        www-data   11u  IPv4  1921509      0t0  TCP *:443 (LISTEN)<br \/>\nnginx     3691674        www-data   12u  IPv4  2579912      0t0  TCP *:8088 (LISTEN)<br \/>\nnginx     3691674        www-data   13u  IPv4  2579913      0t0  TCP *:1935 (LISTEN)<\/p>\n<p>netstat \u548c lsof \u90fd\u662f\u6838\u5fc3 Linux \u8fdb\u7a0b\u7ba1\u7406\u5de5\u5177&#xff0c;\u5728\u5404\u79cd\u5176\u4ed6\u60c5\u5883\u4e2d\u90fd\u5f88\u6709\u7528\u3002<\/p>\n<h3>\u7b2c\u4e94\u6b65 \u2013 \u6536\u96c6\u8f6f\u4ef6\u5305\u7248\u672c<\/h3>\n<p>\u6b64\u65f6&#xff0c;\u4f60\u5e94\u8be5\u5df2\u7ecf\u5bf9\u6e90\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u7684\u670d\u52a1\u6709\u4e86\u4e00\u4e2a\u5f88\u597d\u7684\u4e86\u89e3&#xff0c;\u4f60\u5e94\u8be5\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u5b9e\u65bd\u8fd9\u4e9b\u670d\u52a1\u3002<\/p>\n<p>\u4f60\u5e94\u8be5\u6709\u4e00\u4e2a\u670d\u52a1\u5217\u8868&#xff0c;\u4f60\u77e5\u9053\u4f60\u9700\u8981\u5728\u65b0\u670d\u52a1\u5668\u4e0a\u5b9e\u65bd\u8fd9\u4e9b\u670d\u52a1\u3002\u4e3a\u4e86\u987a\u5229\u8fc7\u6e21&#xff0c;\u91cd\u8981\u7684\u662f\u5c3d\u53ef\u80fd\u5339\u914d\u7248\u672c\u3002<\/p>\n<p>\u4f60\u4e0d\u4e00\u5b9a\u8981\u5ba1\u67e5\u6e90\u7cfb\u7edf\u4e0a\u5b89\u88c5\u7684\u6bcf\u4e2a\u8f6f\u4ef6\u5305&#xff0c;\u5e76\u5c1d\u8bd5\u5728\u65b0\u7cfb\u7edf\u4e0a\u590d\u5236\u5b83&#xff0c;\u4f46\u4f60\u5e94\u8be5\u68c0\u67e5\u5bf9\u4f60\u7684\u9700\u6c42\u91cd\u8981\u7684\u8f6f\u4ef6\u7ec4\u4ef6&#xff0c;\u5e76\u5c1d\u8bd5\u627e\u5230\u5b83\u4eec\u7684\u7248\u672c\u53f7\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u5c1d\u8bd5\u4ece\u8f6f\u4ef6\u672c\u8eab\u83b7\u53d6\u7248\u672c\u53f7&#xff0c;\u6709\u65f6\u901a\u8fc7\u5411\u6bcf\u4e2a\u547d\u4ee4\u4f20\u9012 -v \u6216 &#8211;version \u6807\u5fd7&#xff0c;\u4f46\u901a\u8fc7\u4f60\u7684\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u66f4\u52a0\u76f4\u63a5\u3002\u5982\u679c\u4f60\u4f7f\u7528\u57fa\u4e8e Ubuntu\/Debian \u7684\u7cfb\u7edf&#xff0c;\u4f60\u53ef\u4ee5\u4f7f\u7528 dpkg \u547d\u4ee4\u67e5\u770b\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u7248\u672c&#xff1a;<\/p>\n<p>dpkg -l | grep package_name<\/p>\n<p>\u5982\u679c\u4f60\u4f7f\u7528\u57fa\u4e8e Rocky Linux\u3001RHEL \u6216 Fedora \u7684\u7cfb\u7edf&#xff0c;\u4f60\u53ef\u4ee5\u4f7f\u7528 rpm \u6765\u5b9e\u73b0\u76f8\u540c\u7684\u76ee\u7684&#xff1a;<\/p>\n<p>rpm -qa | grep package_name<\/p>\n<p>\u8fd9\u5c06\u8ba9\u4f60\u5bf9\u8981\u5339\u914d\u7684\u8f6f\u4ef6\u5305\u7248\u672c\u6709\u4e00\u4e2a\u5f88\u597d\u7684\u4e86\u89e3\u3002\u786e\u4fdd\u4fdd\u7559\u4efb\u4f55\u76f8\u5173\u8f6f\u4ef6\u7684\u7248\u672c\u53f7\u3002<\/p>\n<h3>\u7ed3\u8bba<\/h3>\n<p>\u73b0\u5728&#xff0c;\u4f60\u5e94\u8be5\u5df2\u7ecf\u5f88\u6e05\u695a\u6e90\u670d\u52a1\u5668\u4e0a\u9700\u8981\u8fc1\u79fb\u5230\u65b0\u673a\u5668\u7684\u8fdb\u7a0b\u548c\u670d\u52a1\u3002\u4f60\u8fd8\u5e94\u8be5\u5df2\u7ecf\u5b8c\u6210\u4e86\u5141\u8bb8\u4f60\u7684\u4e24\u53f0\u670d\u52a1\u5668\u76f8\u4e92\u901a\u4fe1\u7684\u521d\u6b65\u6b65\u9aa4\u3002<\/p>\n<p>\u4f60\u7684\u8fc1\u79fb\u57fa\u7840\u73b0\u5728\u5df2\u7ecf\u5b8c\u6210\u3002\u5728\u672c\u7cfb\u5217\u7684\u4e0b\u4e00\u7bc7\u6587\u7ae0\u4e2d&#xff0c;\u4f60\u5c06\u5f00\u59cb\u5b9e\u9645\u7684\u8fc1\u79fb\u8fc7\u7a0b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e22\u6b21\uff0c\u6536\u85cf25\u6b21\u3002\u5728\u8bb8\u591a\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u5c06\u6570\u636e\u548c\u64cd\u4f5c\u9700\u6c42\u4ece\u4e00\u4e2a\u670d\u52a1\u5668\u8fc1\u79fb\u5230\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u3002\u60a8\u53ef\u80fd\u9700\u8981\u5728\u65b0\u7684\u6570\u636e\u4e2d\u5fc3\u5b9e\u65bd\u89e3\u51b3\u65b9\u6848\uff0c\u5347\u7ea7\u5230\u66f4\u5927\u7684\u673a\u5668\uff0c\u6216\u8005\u8fc7\u6e21\u5230\u65b0\u7684\u786c\u4ef6\u6216\u65b0\u7684 VPS \u63d0\u4f9b\u5546\u3002\u65e0\u8bba\u60a8\u7684\u539f\u56e0\u662f\u4ec0\u4e48\uff0c\u5728\u4ece\u4e00\u4e2a\u7cfb\u7edf\u8fc1\u79fb\u5230\u53e6\u4e00\u4e2a\u7cfb\u7edf\u65f6\uff0c\u60a8\u5e94\u8be5\u8003\u8651\u8bb8\u591a\u4e0d\u540c\u7684\u56e0\u7d20\u3002\u5982\u679c\u60a8\u6ca1\u6709\u4f7f\u7528 Chef\u3001Puppet \u6216 Ansible \u7b49\u914d\u7f6e\u7ba1\u7406\u89e3\u51b3\u65b9\u6848\uff0c\u8981\u83b7\u5f97\u529f\u80fd\u4e0a\u7b49\u6548\u7684\u914d\u7f6e\u53ef\u80fd\u4f1a\u5f88\u56f0\u96be\u3002\u60a8\u4e0d\u4ec5\u9700\u8981\u4f20\u8f93\u6570\u636e\uff0c\u8fd8\u9700\u8981\u914d\u7f6e\u60a8\u7684\u670d\u52a1\u5728\u65b0\u673a\u5668\u4e0a\u4ee5\u76f8\u540c\u7684\u65b9\u5f0f\u8fd0\u884c\u3002\u5728\u672c\u6307\u5357\u4e2d\uff0c\u60a8\u5c06\u4e86\u89e3\u5982\u4f55\u51c6\u5907\u6e90\u7cfb\u7edf\u548c\u76ee\u6807\u7cfb\u7edf\u8fdb\u884c\u8fc1\u79fb\u3002_linux\u7cfb\u7edf\u8fc1\u79fb\u5230\u53e6\u4e00\u53f0\u670d\u52a1\u5668<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,43,44],"topic":[],"class_list":["post-30779","post","type-post","status-publish","format-standard","hentry","category-server","tag-linux","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u8fc1\u79fb Linux \u670d\u52a1\u5668 \u7b2c\u4e00\u90e8\u5206 - \u7cfb\u7edf\u51c6\u5907 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/30779.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u8fc1\u79fb Linux \u670d\u52a1\u5668 \u7b2c\u4e00\u90e8\u5206 - \u7cfb\u7edf\u51c6\u5907 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e22\u6b21\uff0c\u6536\u85cf25\u6b21\u3002\u5728\u8bb8\u591a\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u5c06\u6570\u636e\u548c\u64cd\u4f5c\u9700\u6c42\u4ece\u4e00\u4e2a\u670d\u52a1\u5668\u8fc1\u79fb\u5230\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u3002\u60a8\u53ef\u80fd\u9700\u8981\u5728\u65b0\u7684\u6570\u636e\u4e2d\u5fc3\u5b9e\u65bd\u89e3\u51b3\u65b9\u6848\uff0c\u5347\u7ea7\u5230\u66f4\u5927\u7684\u673a\u5668\uff0c\u6216\u8005\u8fc7\u6e21\u5230\u65b0\u7684\u786c\u4ef6\u6216\u65b0\u7684 VPS \u63d0\u4f9b\u5546\u3002\u65e0\u8bba\u60a8\u7684\u539f\u56e0\u662f\u4ec0\u4e48\uff0c\u5728\u4ece\u4e00\u4e2a\u7cfb\u7edf\u8fc1\u79fb\u5230\u53e6\u4e00\u4e2a\u7cfb\u7edf\u65f6\uff0c\u60a8\u5e94\u8be5\u8003\u8651\u8bb8\u591a\u4e0d\u540c\u7684\u56e0\u7d20\u3002\u5982\u679c\u60a8\u6ca1\u6709\u4f7f\u7528 Chef\u3001Puppet \u6216 Ansible \u7b49\u914d\u7f6e\u7ba1\u7406\u89e3\u51b3\u65b9\u6848\uff0c\u8981\u83b7\u5f97\u529f\u80fd\u4e0a\u7b49\u6548\u7684\u914d\u7f6e\u53ef\u80fd\u4f1a\u5f88\u56f0\u96be\u3002\u60a8\u4e0d\u4ec5\u9700\u8981\u4f20\u8f93\u6570\u636e\uff0c\u8fd8\u9700\u8981\u914d\u7f6e\u60a8\u7684\u670d\u52a1\u5728\u65b0\u673a\u5668\u4e0a\u4ee5\u76f8\u540c\u7684\u65b9\u5f0f\u8fd0\u884c\u3002\u5728\u672c\u6307\u5357\u4e2d\uff0c\u60a8\u5c06\u4e86\u89e3\u5982\u4f55\u51c6\u5907\u6e90\u7cfb\u7edf\u548c\u76ee\u6807\u7cfb\u7edf\u8fdb\u884c\u8fc1\u79fb\u3002_linux\u7cfb\u7edf\u8fc1\u79fb\u5230\u53e6\u4e00\u53f0\u670d\u52a1\u5668\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/30779.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-20T19:36:02+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/30779.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/30779.html\",\"name\":\"\u5982\u4f55\u8fc1\u79fb Linux \u670d\u52a1\u5668 \u7b2c\u4e00\u90e8\u5206 - \u7cfb\u7edf\u51c6\u5907 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-20T19:36:02+00:00\",\"dateModified\":\"2025-04-20T19:36:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/30779.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/30779.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/30779.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u8fc1\u79fb Linux \u670d\u52a1\u5668 \u7b2c\u4e00\u90e8\u5206 - \u7cfb\u7edf\u51c6\u5907\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u8fc1\u79fb Linux \u670d\u52a1\u5668 \u7b2c\u4e00\u90e8\u5206 - \u7cfb\u7edf\u51c6\u5907 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/30779.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u8fc1\u79fb Linux \u670d\u52a1\u5668 \u7b2c\u4e00\u90e8\u5206 - \u7cfb\u7edf\u51c6\u5907 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e22\u6b21\uff0c\u6536\u85cf25\u6b21\u3002\u5728\u8bb8\u591a\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u5c06\u6570\u636e\u548c\u64cd\u4f5c\u9700\u6c42\u4ece\u4e00\u4e2a\u670d\u52a1\u5668\u8fc1\u79fb\u5230\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u3002\u60a8\u53ef\u80fd\u9700\u8981\u5728\u65b0\u7684\u6570\u636e\u4e2d\u5fc3\u5b9e\u65bd\u89e3\u51b3\u65b9\u6848\uff0c\u5347\u7ea7\u5230\u66f4\u5927\u7684\u673a\u5668\uff0c\u6216\u8005\u8fc7\u6e21\u5230\u65b0\u7684\u786c\u4ef6\u6216\u65b0\u7684 VPS \u63d0\u4f9b\u5546\u3002\u65e0\u8bba\u60a8\u7684\u539f\u56e0\u662f\u4ec0\u4e48\uff0c\u5728\u4ece\u4e00\u4e2a\u7cfb\u7edf\u8fc1\u79fb\u5230\u53e6\u4e00\u4e2a\u7cfb\u7edf\u65f6\uff0c\u60a8\u5e94\u8be5\u8003\u8651\u8bb8\u591a\u4e0d\u540c\u7684\u56e0\u7d20\u3002\u5982\u679c\u60a8\u6ca1\u6709\u4f7f\u7528 Chef\u3001Puppet \u6216 Ansible \u7b49\u914d\u7f6e\u7ba1\u7406\u89e3\u51b3\u65b9\u6848\uff0c\u8981\u83b7\u5f97\u529f\u80fd\u4e0a\u7b49\u6548\u7684\u914d\u7f6e\u53ef\u80fd\u4f1a\u5f88\u56f0\u96be\u3002\u60a8\u4e0d\u4ec5\u9700\u8981\u4f20\u8f93\u6570\u636e\uff0c\u8fd8\u9700\u8981\u914d\u7f6e\u60a8\u7684\u670d\u52a1\u5728\u65b0\u673a\u5668\u4e0a\u4ee5\u76f8\u540c\u7684\u65b9\u5f0f\u8fd0\u884c\u3002\u5728\u672c\u6307\u5357\u4e2d\uff0c\u60a8\u5c06\u4e86\u89e3\u5982\u4f55\u51c6\u5907\u6e90\u7cfb\u7edf\u548c\u76ee\u6807\u7cfb\u7edf\u8fdb\u884c\u8fc1\u79fb\u3002_linux\u7cfb\u7edf\u8fc1\u79fb\u5230\u53e6\u4e00\u53f0\u670d\u52a1\u5668","og_url":"https:\/\/www.wsisp.com\/helps\/30779.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-20T19:36:02+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/30779.html","url":"https:\/\/www.wsisp.com\/helps\/30779.html","name":"\u5982\u4f55\u8fc1\u79fb Linux \u670d\u52a1\u5668 \u7b2c\u4e00\u90e8\u5206 - \u7cfb\u7edf\u51c6\u5907 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-20T19:36:02+00:00","dateModified":"2025-04-20T19:36:02+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/30779.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/30779.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/30779.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u8fc1\u79fb Linux \u670d\u52a1\u5668 \u7b2c\u4e00\u90e8\u5206 - \u7cfb\u7edf\u51c6\u5907"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/30779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=30779"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/30779\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=30779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=30779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=30779"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=30779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}