{"id":423,"date":"2026-04-15T00:51:47","date_gmt":"2026-04-14T16:51:47","guid":{"rendered":"https:\/\/www.loongdi.net\/blog\/?p=423"},"modified":"2026-04-15T00:51:47","modified_gmt":"2026-04-14T16:51:47","slug":"%e5%85%8d%e8%b4%b9%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%88%b0%e5%93%aa%e9%87%8c%e8%8e%b7%e5%8f%96%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.loongdi.net\/blog\/423.html","title":{"rendered":"\u514d\u8d39\u7684\u670d\u52a1\u5668\u5230\u54ea\u91cc\u83b7\u53d6\uff1f"},"content":{"rendered":"<p><p>\u5728\u5f53\u4eca\u7684\u6570\u5b57\u5316\u65f6\u4ee3\uff0c\u62e5\u6709\u4e00\u4e2a\u514d\u8d39\u7684\u670d\u52a1\u5668\u5bf9\u4e8e\u6d4b\u8bd5\u3001\u5b66\u4e60\u548c\u5f00\u53d1\u9879\u76ee\u6765\u8bf4\u975e\u5e38\u6709\u7528\u3002\u672c\u6587\u5c06\u6307\u5bfc\u60a8\u5982\u4f55\u8bbe\u7f6e\u548c\u4f7f\u7528\u4e00\u4e2a\u514d\u8d39\u7684\u4e91\u670d\u52a1\u5668\u3002\u6211\u4eec\u5c06\u4f7f\u7528 <strong>Ubuntu<\/strong> \u64cd\u4f5c\u7cfb\u7edf\uff0c\u56e0\u4e3a\u5b83\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5f00\u6e90\u5e73\u53f0\uff0c\u6613\u4e8e\u914d\u7f6e\u548c\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><h2>\u4efb\u52a1\u6982\u8ff0<\/h2>\n<\/p>\n<p><p>\u901a\u8fc7\u672c\u6587\uff0c\u60a8\u5c06\u5b66\u4f1a\u5982\u4f55\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6ce8\u518c\u5e76\u83b7\u53d6\u4e00\u4e2a\u514d\u8d39\u7684\u4e91\u670d\u52a1\u5668\u3002<\/li>\n<li>\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002<\/li>\n<li>\u5b89\u88c5\u548c\u914d\u7f6e\u5fc5\u8981\u7684\u8f6f\u4ef6\u3002<\/li>\n<li>\u5b89\u5168\u5730\u7ba1\u7406\u670d\u52a1\u5668\u3002<\/li>\n<\/ul>\n<p><h2>\u64cd\u4f5c\u524d\u7684\u51c6\u5907<\/h2>\n<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.loongdi.net\/blog\/wp-content\/uploads\/2026\/03\/3i5XpDP0.jpg\" alt=\"\u514d\u8d39\u7684\u670d\u52a1\u5668\u5230\u54ea\u91cc\u83b7\u53d6\uff1f\" title=\"\u514d\u8d39\u7684\u670d\u52a1\u5668\u5230\u54ea\u91cc\u83b7\u53d6\uff1f\"><\/p>\n<p><p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u6709\u4ee5\u4e0b\u51c6\u5907\u5de5\u4f5c\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u4e00\u53f0\u7535\u8111\uff0c\u5df2\u5b89\u88c5 SSH \u5ba2\u6237\u7aef\uff08\u5982 PuTTY \u6216 MobaXterm\uff09\u3002<\/li>\n<li>\u8bbf\u95ee\u514d\u8d39\u4e91\u670d\u52a1\u63d0\u4f9b\u5546\u7684\u7f51\u7ad9\uff0c\u5982 <a rel=\"nofollow\" href=\"https:\/\/www.vultr.com\/\" target=\"_blank\">Vultr<\/a> \u6216 <a rel=\"nofollow\" href=\"https:\/\/www.digitalocean.com\/\" target=\"_blank\">DigitalOcean<\/a>\u3002<\/li>\n<li>\u6709\u6548\u7684\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u7528\u4e8e\u6ce8\u518c\u8d26\u6237\u3002<\/li>\n<\/ul>\n<p><h2>\u83b7\u53d6\u514d\u8d39\u7684\u4e91\u670d\u52a1\u5668<\/h2>\n<\/p>\n<p><h3>\u6b65\u9aa4 1: \u6ce8\u518c\u8d26\u6237<\/h3>\n<\/p>\n<p><p>\u8bbf\u95ee\u60a8\u9009\u62e9\u7684\u514d\u8d39\u4e91\u670d\u52a1\u63d0\u4f9b\u5546\u7684\u7f51\u7ad9\uff0c\u5e76\u6309\u7167\u6307\u793a\u521b\u5efa\u4e00\u4e2a\u65b0\u8d26\u6237\u3002<\/p>\n<\/p>\n<p><h3>\u6b65\u9aa4 2: \u521b\u5efa\u670d\u52a1\u5668<\/h3>\n<\/p>\n<p><p>\u767b\u5f55\u540e\uff0c\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u670d\u52a1\u5668\u5b9e\u4f8b\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u9009\u62e9\u60a8\u7684\u6570\u636e\u4e2d\u5fc3\u4f4d\u7f6e\u3002<\/li>\n<li>\u9009\u62e9\u201c\u514d\u8d39\u8ba1\u5212\u201d\u6216\u201c\u514d\u8d39\u5957\u9910\u201d\u3002<\/li>\n<li>\u9009\u62e9 <strong>Ubuntu<\/strong> \u4f5c\u4e3a\u64cd\u4f5c\u7cfb\u7edf\u3002<\/li>\n<li>\u914d\u7f6e\u670d\u52a1\u5668\u540d\u79f0\u3001\u5927\u5c0f\u548c\u5176\u4ed6\u8bbe\u7f6e\u3002<\/li>\n<li>\u70b9\u51fb\u201c\u521b\u5efa\u201d\u6309\u94ae\u3002<\/li>\n<\/ol>\n<p><h2>\u8fde\u63a5\u5230\u670d\u52a1\u5668<\/h2>\n<\/p>\n<p><h3>\u6b65\u9aa4 1: \u83b7\u53d6\u670d\u52a1\u5668\u4fe1\u606f<\/h3>\n<\/p>\n<p><p>\u670d\u52a1\u5668\u521b\u5efa\u5b8c\u6210\u540e\uff0c\u60a8\u5c06\u83b7\u5f97\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u670d\u52a1\u5668 IP \u5730\u5740\u3002<\/li>\n<li>\u670d\u52a1\u5668\u7528\u6237\u540d\uff08\u901a\u5e38\u662f root\uff09\u3002<\/li>\n<li>SSH \u5bc6\u94a5\u6216\u5bc6\u7801\u3002<\/li>\n<\/ul>\n<p><h3>\u6b65\u9aa4 2: \u4f7f\u7528 SSH \u8fde\u63a5\u5230\u670d\u52a1\u5668<\/h3>\n<\/p>\n<p><p>\u6253\u5f00\u60a8\u7684 SSH \u5ba2\u6237\u7aef\uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff1a<\/p>\n<\/p>\n<p><pre><code>ssh -i \/path\/to\/your\/private\/key.pem user@your_server_ip<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u60a8\u4f7f\u7528\u5bc6\u7801\u767b\u5f55\uff0c\u5219\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code>ssh user@your_server_ip<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u5b89\u88c5\u548c\u914d\u7f6e\u8f6f\u4ef6<\/h2>\n<\/p>\n<p><h3>\u6b65\u9aa4 1: \u66f4\u65b0\u7cfb\u7edf<\/h3>\n<\/p>\n<p><p>\u767b\u5f55\u540e\uff0c\u9996\u5148\u66f4\u65b0\u60a8\u7684\u7cfb\u7edf\u5305\u5217\u8868\u548c\u5b89\u88c5\u66f4\u65b0\uff1a<\/p>\n<\/p>\n<p><pre><code>sudo apt update<\/p>\r\n<p>sudo apt upgrade<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u6b65\u9aa4 2: \u5b89\u88c5\u8f6f\u4ef6<\/h3>\n<\/p>\n<p><p>\u6839\u636e\u60a8\u7684\u9700\u6c42\uff0c\u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6\u3002\u4f8b\u5982\uff0c\u5b89\u88c5 Apache \u670d\u52a1\u5668\uff1a<\/p>\n<\/p>\n<p><pre><code>sudo apt install apache2<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u542f\u52a8 Apache \u670d\u52a1\u5e76\u8bbe\u7f6e\u5b83\u5f00\u673a\u81ea\u542f\uff1a<\/p>\n<\/p>\n<p><pre><code>sudo systemctl start apache2<\/p>\r\n<p>sudo systemctl enable apache2<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u5b89\u5168\u5730\u7ba1\u7406\u670d\u52a1\u5668<\/h2>\n<\/p>\n<p><h3>\u6b65\u9aa4 1: \u914d\u7f6e\u9632\u706b\u5899<\/h3>\n<\/p>\n<p><p>\u914d\u7f6e UFW\uff08Uncomplicated Firewall\uff09\u4ee5\u5141\u8bb8 Apache \u670d\u52a1\u5668\u7684\u6d41\u91cf\uff1a<\/p>\n<\/p>\n<p><pre><code>sudo ufw allow in \"Apache\"<\/p>\r\n<p>sudo ufw enable<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u6b65\u9aa4 2: \u66f4\u65b0 SSH \u914d\u7f6e<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u63d0\u9ad8\u5b89\u5168\u6027\uff0c\u60a8\u53ef\u4ee5\u66f4\u6539 SSH \u7684\u9ed8\u8ba4\u7aef\u53e3\u6216\u7981\u7528 root \u767b\u5f55\uff1a<\/p>\n<\/p>\n<p><pre><code>sudo vi \/etc\/ssh\/sshd_config<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u627e\u5230\u4ee5\u4e0b\u884c\u5e76\u66f4\u6539\u6216\u6dfb\u52a0\u5b83\u4eec\uff1a<\/p>\n<\/p>\n<p><pre><code>Port 2222  \u66f4\u6539\u9ed8\u8ba4\u7aef\u53e3<\/p>\r\n<p>PermitRootLogin no  \u7981\u7528 root \u767b\u5f55<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4fdd\u5b58\u5e76\u9000\u51fa\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u542f SSH \u670d\u52a1\uff1a<\/p>\n<\/p>\n<p><pre><code>sudo systemctl restart ssh<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u5e38\u89c1\u95ee\u9898\u4e0e\u6ce8\u610f\u4e8b\u9879<\/h2>\n<\/p>\n<ul>\n<li>\u8fde\u63a5\u5931\u8d25\uff1a\u8bf7\u68c0\u67e5\u60a8\u7684 SSH \u5bc6\u94a5\u8def\u5f84\u662f\u5426\u6b63\u786e\uff0c\u6216\u8005\u662f\u5426\u8f93\u5165\u4e86\u6b63\u786e\u7684\u5bc6\u7801\u3002<\/li>\n<li>\u8f6f\u4ef6\u5b89\u88c5\u5931\u8d25\uff1a\u786e\u4fdd\u60a8\u7684\u670d\u52a1\u5668\u5df2\u8fde\u63a5\u5230\u4e92\u8054\u7f51\uff0c\u5e76\u4e14\u60a8\u6709\u6743\u8bbf\u95ee\u6240\u9700\u7684\u8f6f\u4ef6\u5305\u3002<\/li>\n<li>\u670d\u52a1\u5668\u901f\u5ea6\u6162\uff1a\u9009\u62e9\u4e00\u4e2a\u79bb\u60a8\u8f83\u8fd1\u7684\u6570\u636e\u4e2d\u5fc3\uff0c\u4ee5\u51cf\u5c11\u5ef6\u8fdf\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u60a8\u5e94\u8be5\u80fd\u591f\u6210\u529f\u8bbe\u7f6e\u548c\u4f7f\u7528\u4e00\u4e2a\u514d\u8d39\u7684\u4e91\u670d\u52a1\u5668\u3002\u795d\u60a8\u64cd\u4f5c\u987a\u5229\uff01<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5f53\u4eca\u7684\u6570\u5b57\u5316\u65f6\u4ee3\uff0c\u62e5\u6709\u4e00\u4e2a\u514d\u8d39\u7684\u670d\u52a1\u5668\u5bf9\u4e8e\u6d4b\u8bd5\u3001\u5b66\u4e60\u548c\u5f00\u53d1\u9879\u76ee\u6765\u8bf4\u975e\u5e38\u6709\u7528\u3002\u672c\u6587\u5c06\u6307\u5bfc\u60a8\u5982\u4f55\u8bbe\u7f6e\u548c\u4f7f\u7528\u4e00\u4e2a\u514d\u8d39\u7684\u4e91\u670d\u52a1\u5668\u3002\u6211\u4eec\u5c06\u4f7f\u7528 Ubuntu \u64cd\u4f5c\u7cfb\u7edf\uff0c\u56e0\u4e3a\u5b83\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5f00\u6e90\u5e73\u53f0\uff0c\u6613\u4e8e\u914d\u7f6e\u548c\u4f7f\u7528\u3002 \u4efb\u52a1\u6982\u8ff0 \u901a\u8fc7\u672c\u6587\uff0c\u60a8\u5c06\u5b66\u4f1a\u5982\u4f55\uff1a&#8230;<\/p>\n","protected":false},"author":1,"featured_media":49,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"topic":[],"class_list":["post-423","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hw"],"_links":{"self":[{"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/posts\/423","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/comments?post=423"}],"version-history":[{"count":1,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/posts\/423\/revisions"}],"predecessor-version":[{"id":424,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/posts\/423\/revisions\/424"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/media\/49"}],"wp:attachment":[{"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/media?parent=423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/categories?post=423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/tags?post=423"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/topic?post=423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}