{"id":21261,"date":"2022-10-27T01:10:52","date_gmt":"2022-10-26T17:10:52","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=21261"},"modified":"2022-10-27T01:11:37","modified_gmt":"2022-10-26T17:11:37","slug":"securi-pi","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/securi-pi.html","title":{"rendered":"Securi-Pi\uff1a\u4f7f\u7528\u6811\u8393\u6d3e\u4f5c\u4e3a\u5b89\u5168\u8df3\u677f"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u50cf\u5f88\u591a LinuxJournal \u7684\u8bfb\u8005\u4e00\u6837\uff0c\u6211\u4e5f\u8fc7\u4e0a\u4e86\u5f53\u4eca\u975e\u5e38\u666e\u904d\u7684\u201c\u79d1\u6280\u6e38\u7267\u201d\u751f\u6d3b\uff0c\u5728\u7f51\u7edc\u4e4b\u95f4\uff0c\u4ece\u4e00\u4e2a\u63a5\u5165\u70b9\u5230\u53e6\u4e00\u4e2a\u63a5\u5165\u70b9\uff0c\u6211\u4eec\u8eab\u5904\u73b0\u5b9e\u4e16\u754c\u7684\u4e0d\u540c\u5730\u65b9\u5374\u59cb\u7ec8\u4fdd\u6301\u8fde\u63a5\u5230\u4e92\u8054\u7f51\u548c\u65e5\u5e38\u4f7f\u7528\u7684\u5176\u5b83\u7f51\u7edc\u4e0a\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u8fd1\u6765\u6211\u53d1\u73b0\u8d8a\u6765\u8d8a\u591a\u7684\u7f51\u7edc\u73af\u5883\u5f00\u59cb\u5c4f\u853d\u5bf9\u5916\u7684\u5e38\u7528\u7aef\u53e3\u6bd4\u5982 SMTP\uff08\u7aef\u53e3 25\uff09\uff0cSSH\uff08\u7aef\u53e3 22\uff09\u4e4b\u7c7b\u7684\u3002\u5f53\u4f60\u8d70\u8fdb\u4e00\u5bb6\u5496\u5561\u9986\u7136\u540e\u60f3 SSH \u5230\u4f60\u7684\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u505a\u70b9\u4e8b\u60c5\u7684\u65f6\u5019\u53d1\u73b0\u7aef\u53e3 22 \u88ab\u5c4f\u853d\u4e86\u662f\u4e00\u4ef6\u5f88\u70e6\u7684\u4e8b\u60c5\u3002
\n\"securi-pi_00\"
\n\u4e0d\u8fc7\uff0c\u6211\u5230\u76ee\u524d\u4e3a\u6b62\u8fd8\u6ca1\u53d1\u73b0\u6709\u4ec0\u4e48\u7f51\u7edc\u73af\u5883\u4f1a\u628a HTTPS \u7ed9\u5899\u4e86\uff08\u7aef\u53e3 443\uff09\u3002\u5728\u7a0d\u5fae\u914d\u7f6e\u4e86\u4e00\u4e0b\u5bb6\u4e2d\u7684\u6811\u8393\u6d3e 2 \u4e4b\u540e\uff0c\u6211\u6210\u529f\u5730\u8ba9\u81ea\u5df1\u901a\u8fc7\u63a5\u5165\u6811\u8393\u6d3e\u7684 443 \u7aef\u53e3\u5145\u5f53\u8df3\u677f\uff0c\u4ece\u800c\u8ba9\u6211\u5728\u5404\u79cd\u7f51\u7edc\u73af\u5883\u4e0b\u90fd\u80fd\u8fde\u4e0a\u60f3\u8981\u7684\u76ee\u6807\u7aef\u53e3\u3002\u7b80\u800c\u8a00\u4e4b\uff0c\u6211\u628a\u5bb6\u4e2d\u7684\u6811\u8393\u6d3e\u8bbe\u7f6e\u6210\u4e86\u4e00\u4e2a OpenVPN \u7684\u7aef\u70b9\u548c SSH \u7aef\u70b9\uff0c\u540c\u65f6\u4e5f\u662f\u4e00\u4e2a Apache \u670d\u52a1\u5668\uff0c\u6240\u6709\u8fd9\u4e9b\u670d\u52a1\u90fd\u76d1\u542c\u5728 443 \u7aef\u53e3\u4e0a\uff0c\u4ee5\u4fbf\u53ef\u4ee5\u9650\u5236\u6211\u4e0d\u60f3\u66b4\u9732\u7684\u7f51\u7edc\u670d\u52a1\u3002<\/p>\n

\u5907\u6ce8<\/strong><\/div>\n

\u6b64\u89e3\u51b3\u65b9\u6848\u80fd\u641e\u5b9a\u5927\u591a\u6570\u6709\u9650\u5236\u7684\u7f51\u7edc\u73af\u5883\uff0c\u4f46\u6709\u4e9b\u9632\u706b\u5899\u4f1a\u5bf9\u5916\u90e8\u6d41\u91cf\u8c03\u7528 \u6df1\u5ea6\u5305\u68c0\u67e5 \uff0c\u5b83\u4eec\u65f6\u5e38\u80fd\u5c4f\u853d\u6389\u7528\u672c\u7bc7\u6587\u7ae0\u91cc\u7684\u65b9\u5f0f\u4f20\u8f93\u7684\u4fe1\u606f\u3002\u4e0d\u8fc7\u6211\u5230\u76ee\u524d\u4e3a\u6b62\u8fd8\u6ca1\u5728\u8fd9\u6837\u7684\u9632\u706b\u5899\u540e\u6d4b\u8bd5\u8fc7\u3002\u540c\u65f6\uff0c\u5c3d\u7ba1\u6211\u4f7f\u7528\u4e86\u5f88\u591a\u57fa\u4e8e\u5bc6\u7801\u5b66\u7684\u5de5\u5177\uff08OpenVPN\uff0cHTTPS\uff0cSSH\uff09\uff0c\u6211\u5e76\u6ca1\u6709\u975e\u5e38\u4e25\u683c\u5730\u5ba1\u8ba1\u8fc7\u8fd9\u5957\u914d\u7f6e\u65b9\u6848\uff08LCTT \u8bd1\u6ce8\uff1a\u4f5c\u8005\u7684\u610f\u601d\u662f\u6307\u8fd9\u5957\u65b9\u6848\u80fd\u5e2e\u4f60\u7ed5\u8fc7\u7aef\u53e3\u9650\u5236\uff0c\u4f46\u4e0d\u4ee3\u8868\u4f60\u7684\u6d3b\u52a8\u5c31\u662f\u5b8c\u5168\u5b89\u5168\u7684\uff09\u3002\u6709\u65f6\u5019\u751a\u81f3 DNS \u670d\u52a1\u90fd\u4f1a\u6cc4\u9732\u4f60\u7684\u4fe1\u606f\uff0c\u5f88\u53ef\u80fd\u5728\u6211\u6ca1\u6709\u8003\u8651\u5468\u5230\u7684\u89d2\u843d\u91cc\u4f1a\u6709\u9057\u6f0f\u3002\u6211\u5f3a\u70c8\u4e0d\u63a8\u8350\u628a\u6b64\u8df3\u677f\u914d\u7f6e\u65b9\u6848\u5f53\u4f5c\u662f\u4e07\u65e0\u4e00\u5931\u7684\u9690\u85cf\u7f51\u7edc\u6d41\u91cf\u7684\u529e\u6cd5\uff0c\u6b64\u914d\u7f6e\u53ea\u662f\u5e0c\u671b\u80fd\u7ed5\u8fc7\u4e00\u4e9b\u7aef\u53e3\u9650\u5236\u8fde\u4e0a\u7f51\u7edc\uff0c\u800c\u4e0d\u662f\u505a\u4e00\u4e9b\u5371\u9669\u7684\u4e8b\u60c5\u3002<\/p>\n

\u8d77\u6b65<\/strong><\/div>\n

\u8ba9\u6211\u4eec\u5148\u4ece\u4f60\u9700\u8981\u4ec0\u4e48\u8bf4\u8d77\uff0c\u6211\u7528\u7684\u662f\u6811\u8393\u6d3e 2\uff0c\u88c5\u8f7d\u4e86\u6700\u65b0\u7248\u672c\u7684 Raspbian\uff0c\u4e0d\u8fc7\u8fd9\u4e2a\u914d\u7f6e\u4e5f\u5e94\u8be5\u80fd\u5728\u6811\u8393\u6d3e Model B \u4e0a\u8fd0\u884c\uff1b512MB \u7684\u5185\u5b58\u5bf9\u6211\u4eec\u6765\u8bf4\u7ef0\u7ef0\u6709\u4f59\u4e86\uff0c\u867d\u7136\u6027\u80fd\u53ef\u80fd\u6ca1\u6709\u6811\u8393\u6d3e 2\u8fd9\u4e48\u597d\uff0c\u6bd5\u7adf\u76f8\u6bd4\u4e8e\u56db\u6838\u5fc3\u7684\u6811\u8393\u6d3e 2\uff0c Model B \u53ea\u6709\u4e00\u9897\u5355\u6838\u5fc3 CPU\u3002\u6211\u7684\u6811\u8393\u6d3e\u653e\u7f6e\u5728\u5bb6\u91cc\u7684\u9632\u706b\u5899\u548c\u8def\u7531\u5668\u7684\u540e\u9762\uff0c\u6240\u4ee5\u6211\u8fd8\u80fd\u7528\u8fd9\u4e2a\u6811\u8393\u6d3e\u4f5c\u4e3a\u8df3\u677f\u8bbf\u95ee\u5bb6\u91cc\u7684\u5176\u4ed6\u7535\u5b50\u8bbe\u5907\u3002\u540c\u65f6\u8fd9\u4e5f\u610f\u5473\u7740\u6211\u7684\u6d41\u91cf\u5728\u4e92\u8054\u7f51\u4e0a\u770b\u8d77\u6765\u4eff\u4f5b\u6765\u81ea\u6211\u5bb6\u7684 ip \u5730\u5740\uff0c\u6240\u4ee5\u8fd9\u4e5f\u7b97\u67d0\u79cd\u610f\u4e49\u4e0a\u4fdd\u62a4\u4e86\u6211\u7684\u533f\u540d\u6027\u3002\u5982\u679c\u4f60\u6ca1\u6709\u6811\u8393\u6d3e\uff0c\u6216\u8005\u4e0d\u60f3\u4ece\u5bb6\u91cc\u8fd0\u884c\u8fd9\u4e2a\u670d\u52a1\uff0c\u90a3\u4f60\u5b8c\u5168\u53ef\u4ee5\u628a\u8fd9\u4e2a\u914d\u7f6e\u653e\u5728\u4e00\u53f0\u5c0f\u578b\u4e91\u670d\u52a1\u5668\u4e0a\uff08LCTT \u8bd1\u6ce8\uff1a\u6bd4\u5982 IPS \uff09\u3002\u4f60\u53ea\u8981\u786e\u4fdd\u670d\u52a1\u5668\u8fd0\u884c\u7740\u57fa\u4e8e Debian \u7684 Linux \u53d1\u884c\u7248\u5373\u53ef\uff0c\u8fd9\u4efd\u6307\u5357\u4f9d\u7136\u53ef\u7528\u3002<\/p>\n

\"Securi-Pi\uff1a\u4f7f\u7528\u6811\u8393\u6d3e\u4f5c\u4e3a\u5b89\u5168\u8df3\u677f\"<\/p>\n

\u56fe 1 \u6811\u8393\u6d3e\uff0c\u5373\u5c06\u6210\u4e3a\u6211\u4eec\u7684\u52a0\u5bc6\u7f51\u7edc\u7aef\u70b9<\/em><\/p>\n

\u5b89\u88c5\u5e76\u914d\u7f6e BIND<\/strong><\/div>\n

\u65e0\u8bba\u4f60\u662f\u7528\u6811\u8393\u6d3e\u8fd8\u662f\u4e00\u53f0\u670d\u52a1\u5668\uff0c\u5f53\u4f60\u6210\u529f\u542f\u52a8\u4e4b\u540e\u4f60\u5c31\u53ef\u4ee5\u5b89\u88c5 BIND \u4e86\uff0c\u8fd9\u662f\u4e00\u4e2a\u9a71\u52a8\u4e86\u4e92\u8054\u7f51\u76f8\u5f53\u4e00\u90e8\u5206\u7684\u57df\u540d\u670d\u52a1\u8f6f\u4ef6\u3002\u4f60\u5c06\u4f1a\u628a BIND \u4ec5\u4ec5\u4f5c\u4e3a\u7f13\u5b58\u57df\u540d\u670d\u52a1\u4f7f\u7528\uff0c\u800c\u4e0d\u7528\u628a\u5b83\u914d\u7f6e\u4e3a\u7528\u6765\u5904\u7406\u6765\u81ea\u4e92\u8054\u7f51\u7684\u57df\u540d\u8bf7\u6c42\u3002\u5b89\u88c5 BIND \u4f1a\u8ba9\u4f60\u62e5\u6709\u4e00\u4e2a\u53ef\u4ee5\u88ab OpenVPN \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\u3002\u5b89\u88c5 BIND \u5341\u5206\u7b80\u5355\uff0capt-get \u5c31\u53ef\u4ee5\u76f4\u63a5\u641e\u5b9a:<\/p>\n

root@test:~# apt-get install bind9\r\nReading package lists... Done\r\nBuilding dependency tree\r\nReading state information... Done\r\nThe following extra packages will be installed:\r\n  bind9utils\r\nSuggested packages:\r\n  bind9-doc resolvconf ufw\r\nThe following NEW packages will be installed:\r\n  bind9 bind9utils\r\n0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.\r\nNeed to get 490 kB of archives.\r\nAfter this operation, 1,128 kB of additional disk space will be used.\r\nDo you want to continue [Y\/n]? y\r\n<\/pre>\n

\u5728\u6211\u4eec\u628a BIND \u4f5c\u4e3a\u7f13\u5b58\u57df\u540d\u670d\u52a1\u5668\u4e4b\u524d\uff0c\u8fd8\u6709\u4e00\u4e9b\u5c0f\u7ec6\u8282\u9700\u8981\u914d\u7f6e\u3002\u4e24\u4e2a\u4fee\u6539\u90fd\u5728 \/etc\/bind\/named.conf.options \u91cc\u5b8c\u6210\u3002\u9996\u5148\u4f60\u8981\u53d6\u6d88\u6ce8\u91ca\u6389 forwarders \u8fd9\u4e00\u8282\u5185\u5bb9\uff0c\u540c\u65f6\u4f60\u8fd8\u8981\u589e\u52a0\u4e00\u4e2a\u53ef\u4ee5\u8f6c\u53d1\u57df\u540d\u8bf7\u6c42\u7684\u76ee\u6807\u670d\u52a1\u5668\u3002\u4f5c\u4e3a\u4f8b\u5b50\u6211\u4f1a\u7528 Google \u7684 DNS \u670d\u52a1\u5668\uff088.8.8.8\uff09\uff08LCTT \u8bd1\u6ce8\uff1a\u56fd\u5185\u7684\u8bdd\u9700\u8981\u627e\u4e00\u4e2a\u66ff\u4ee3\u54c1\uff09\uff1b\u6587\u4ef6\u7684 forwarders \u8282\u770b\u4e0a\u53bb\u5927\u81f4\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n

forwarders {\r\n    8.8.8.8;\r\n};\r\n<\/pre>\n

\u7b2c\u4e8c\u70b9\u4f60\u9700\u8981\u505a\u7684\u66f4\u6539\u662f\u5141\u8bb8\u6765\u81ea\u5185\u7f51\u548c\u672c\u673a\u7684\u67e5\u8be2\u8bf7\u6c42\uff0c\u76f4\u63a5\u628a\u8fd9\u4e00\u884c\u52a0\u5165\u914d\u7f6e\u6587\u4ef6\u7684\u540e\u9762\uff0c\u8bb0\u5f97\u653e\u5728\u6700\u540e\u4e00\u4e2a }; \u4e4b\u524d\u5c31\u53ef\u4ee5\u4e86\uff1a<\/p>\n

allow-query { 192.168.1.0\/24; 127.0.0.0\/16; };\r\n<\/pre>\n

\u4e0a\u9762\u90a3\u884c\u914d\u7f6e\u4f1a\u5141\u8bb8\u6b64 DNS \u670d\u52a1\u5668\u63a5\u6536\u6765\u81ea\u5176\u6240\u5728\u7684\u7f51\u7edc\uff08\u5728\u672c\u4f8b\u4e2d\uff0c\u6211\u7684\u7f51\u7edc\u5c31\u5728\u6211\u7684\u9632\u706b\u5899\u4e4b\u540e\uff09\u548c\u672c\u673a\u7684\u8bf7\u6c42\u3002\u4e0b\u4e00\u6b65\uff0c\u4f60\u9700\u8981\u91cd\u542f\u4e00\u4e0b BIND \u7684\u670d\u52a1\uff1a<\/p>\n

root@test:~# \/etc\/init.d\/bind9 restart\r\n[....] Stopping domain name service...: bind9\r\nwaiting for pid 13209 to die\r\n. ok\r\n[ ok ] Starting domain name service...: bind9.\r\n<\/pre>\n

\u73b0\u5728\u4f60\u53ef\u4ee5\u6d4b\u8bd5\u4e00\u4e0b nslookup \u6765\u786e\u4fdd\u4f60\u7684\u670d\u52a1\u6b63\u5e38\u8fd0\u884c\u4e86\uff1a<\/p>\n

root@test:~# nslookup\r\n> server localhost\r\nDefault server: localhost\r\nAddress: 127.0.0.1#53\r\n> www.google.com\r\nServer:     localhost\r\nAddress:    127.0.0.1#53\r\n\r\nNon-authoritative answer:\r\nName:   www.google.com\r\nAddress: 173.194.33.176\r\nName:   www.google.com\r\nAddress: 173.194.33.177\r\nName:   www.google.com\r\nAddress: 173.194.33.178\r\nName:   www.google.com\r\nAddress: 173.194.33.179\r\nName:   www.google.com\r\nAddress: 173.194.33.180\r\n<\/pre>\n

\u5b8c\u7f8e\uff01\u73b0\u5728\u4f60\u7684\u7cfb\u7edf\u91cc\u5df2\u7ecf\u6709\u4e00\u4e2a\u6b63\u5e38\u7684\u57df\u540d\u670d\u52a1\u5728\u5de5\u4f5c\u4e86\uff0c\u4e0b\u4e00\u6b65\u6211\u4eec\u6765\u914d\u7f6e\u4e00\u4e0bOpenVPN\u3002<\/p>\n

\u5b89\u88c5\u5e76\u914d\u7f6e OpenVPN<\/strong><\/div>\n

OpenVPN \u662f\u4e00\u4e2a\u8fd0\u7528 SSL\/TLS \u4f5c\u4e3a\u5bc6\u94a5\u4ea4\u6362\u7684\u5f00\u6e90 VPN \u89e3\u51b3\u65b9\u6848\u3002\u540c\u65f6\u5b83\u4e5f\u975e\u5e38\u4fbf\u4e8e\u5728 Linux \u73af\u5883\u4e0b\u90e8\u7f72\u3002\u914d\u7f6e OpenVPN \u53ef\u80fd\u6709\u4e00\u70b9\u70b9\u96be\uff0c\u4e0d\u8fc7\u5176\u5b9e\u4f60\u4e5f\u4e0d\u9700\u8981\u5728\u9ed8\u8ba4\u7684\u914d\u7f6e\u6587\u4ef6\u91cc\u505a\u592a\u591a\u4fee\u6539\u3002\u9996\u5148\u4f60\u9700\u8981\u8fd0\u884c\u4e00\u4e0b apt-get \u6765\u5b89\u88c5 OpenVPN\uff1a<\/p>\n

root@test:~# apt-get install openvpn\r\nReading package lists... Done\r\nBuilding dependency tree\r\nReading state information... Done\r\nThe following extra packages will be installed:\r\n  liblzo2-2 libpkcs11-helper1\r\nSuggested packages:\r\n  resolvconf\r\nThe following NEW packages will be installed:\r\n  liblzo2-2 libpkcs11-helper1 openvpn\r\n0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.\r\nNeed to get 621 kB of archives.\r\nAfter this operation, 1,489 kB of additional disk space will be used.\r\nDo you want to continue [Y\/n]? y\r\n<\/pre>\n

\u73b0\u5728 OpenVPN \u5df2\u7ecf\u5b89\u88c5\u597d\u4e86\uff0c\u4f60\u9700\u8981\u53bb\u914d\u7f6e\u5b83\u4e86\u3002OpenVPN \u662f\u57fa\u4e8e SSL \u7684\uff0c\u5e76\u4e14\u5b83\u540c\u65f6\u4f9d\u8d56\u4e8e\u670d\u52a1\u7aef\u548c\u5ba2\u6237\u7aef\u4e24\u65b9\u7684\u8bc1\u4e66\u6765\u5de5\u4f5c\u3002\u4e3a\u4e86\u751f\u6210\u8fd9\u4e9b\u8bc1\u4e66\uff0c\u4f60\u9700\u8981\u5728\u673a\u5668\u4e0a\u914d\u7f6e\u4e00\u4e2a\u8bc1\u4e66\u7b7e\u53d1\uff08CA\uff09\u3002\u5e78\u8fd0\u5730\uff0cOpenVPN \u5728\u5b89\u88c5\u4e2d\u81ea\u5e26\u4e86\u4e00\u4e9b\u7528\u4e8e\u751f\u6210\u8bc1\u4e66\u7684\u811a\u672c\u6bd4\u5982 \u201ceasy-rsa\u201d \u6765\u5e2e\u52a9\u4f60\u52a0\u5feb\u8fd9\u4e2a\u8fc7\u7a0b\u3002\u4f60\u5c06\u8981\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u76ee\u5f55\u7528\u4e8e\u653e\u7f6e easy-rsa \u811a\u672c\uff0c\u4ece\u6a21\u677f\u76ee\u5f55\u590d\u5236\u8fc7\u6765\uff1a<\/p>\n

root@test:~# mkdir \/etc\/openvpn\/easy-rsa\r\nroot@test:~# cp -rpv \/usr\/share\/doc\/openvpn\/examples\/easy-rsa\/2.0\/* \/etc\/openvpn\/easy-rsa\/\r\n<\/pre>\n

\u4e0b\u4e00\u6b65\uff0c\u628a vars \u6587\u4ef6\u590d\u5236\u4e00\u4e2a\u5907\u4efd\uff1a<\/p>\n

root@test:\/etc\/openvpn\/easy-rsa# cp vars vars.bak\r\n<\/pre>\n

\u63a5\u4e0b\u6765\uff0c\u7f16\u8f91\u4e00\u4e0b vars \u4ee5\u8ba9\u5176\u4e2d\u7684\u4fe1\u606f\u7b26\u5408\u4f60\u7684\u72b6\u6001\u3002\u6211\u5c06\u4ee5\u6211\u9700\u8981\u7f16\u8f91\u7684\u4fe1\u606f\u4f5c\u4e3a\u4f8b\u5b50\uff1a<\/p>\n

KEY_SIZE=4096\r\nKEY_COUNTRY=\"US\"\r\nKEY_PROVINCE=\"CA\"\r\nKEY_CITY=\"Silicon Valley\"\r\nKEY_ORG=\"Linux Journal\"\r\nKEY_EMAIL=\"bill.childers@linuxjournal.com\"\r\n<\/pre>\n

\u4e0b\u4e00\u6b65\u662f\u5bfc\u5165\uff08source\uff09\u4e00\u4e0b vars \u4e2d\u7684\u73af\u5883\u53d8\u91cf\uff0c\u8fd9\u6837\u7cfb\u7edf\u5c31\u80fd\u628a\u5176\u4e2d\u7684\u4fe1\u606f\u5f53\u4f5c\u73af\u5883\u53d8\u91cf\u5904\u7406\u4e86\uff1a<\/p>\n

root@test:\/etc\/openvpn\/easy-rsa# source .\/vars\r\nNOTE: If you run .\/clean-all, I will be doing a rm -rf on \/etc\/openvpn\/easy-rsa\/keys\r\n<\/pre>\n
\u642d\u5efa CA\uff08\u8bc1\u4e66\u7b7e\u53d1\uff09<\/strong><\/div>\n

\u63a5\u4e0b\u6765\u4f60\u8981\u8fd0\u884c\u4e00\u4e0b clean-all \u6765\u786e\u4fdd\u6709\u4e00\u4e2a\u6e05\u7406\u5e72\u51c0\u7684\u7cfb\u7edf\u5de5\u4f5c\u73af\u5883\uff0c\u7d27\u63a5\u7740\u4f60\u5c31\u8981\u505a\u8bc1\u4e66\u7b7e\u53d1\u4e86\u3002\u6ce8\u610f\u4e00\u4e0b\u6211\u4fee\u6539\u4e86\u4e00\u4e9b changeme \u7684\u6240\u63d0\u793a\u4fee\u6539\u7684\u5185\u5bb9\u4ee5\u7b26\u5408\u6211\u9700\u8981\u7684\u5b89\u88c5\u60c5\u51b5\uff1a<\/p>\n

root@test:\/etc\/openvpn\/easy-rsa# .\/clean-all\r\nroot@test:\/etc\/openvpn\/easy-rsa# .\/build-ca\r\nGenerating a 4096 bit RSA private key\r\n...................................................++\r\n...................................................++\r\nwriting new private key to 'ca.key'\r\n-----\r\nYou are about to be asked to enter information that\r\nwill be incorporated into your certificate request.\r\nWhat you are about to enter is what is called a\r\nDistinguished Name or a DN.\r\nThere are quite a few fields but you can leave some\r\nblank. For some fields there will be a default value,\r\nIf you enter '.', the field will be left blank.\r\n-----\r\nCountry Name (2 letter code) [US]:\r\nState or Province Name (full name) [CA]:\r\nLocality Name (eg, city) [Silicon Valley]:\r\nOrganization Name (eg, company) [Linux Journal]:\r\nOrganizational Unit Name (eg, section) [changeme]:SecTeam\r\nCommon Name (eg, your name or your server's hostname [changeme]:test.linuxjournal.com\r\nName [changeme]:test.linuxjournal.com\r\nEmail Address [bill.childers@linuxjournal.com]:\r\n<\/pre>\n
\u751f\u6210\u670d\u52a1\u7aef\u8bc1\u4e66<\/strong><\/div>\n

\u4e00\u65e6 CA \u521b\u5efa\u597d\u4e86\uff0c\u4f60\u63a5\u7740\u5c31\u53ef\u4ee5\u751f\u6210\u5ba2\u6237\u7aef\u7684 OpenVPN \u8bc1\u4e66\u4e86\uff1a<\/p>\n

root@test:\/etc\/openvpn\/easy-rsa# .\/build-key-server test.linuxjournal.com\r\nGenerating a 4096 bit RSA private key\r\n...................................................++\r\nwriting new private key to 'test.linuxjournal.com.key'\r\n-----\r\nYou are about to be asked to enter information that\r\nwill be incorporated into your certificate request.\r\nWhat you are about to enter is what is called a\r\nDistinguished Name or a DN.\r\nThere are quite a few fields but you can leave some\r\nblank. For some fields there will be a default value,\r\nIf you enter '.', the field will be left blank.\r\n-----\r\nCountry Name (2 letter code) [US]:\r\nState or Province Name (full name) [CA]:\r\nLocality Name (eg, city) [Silicon Valley]:\r\nOrganization Name (eg, company) [Linux Journal]:\r\nOrganizational Unit Name (eg, section) [changeme]:SecTeam\r\nCommon Name (eg, your name or your server's hostname) [test.linuxjournal.com]:\r\nName [changeme]:test.linuxjournal.com\r\nEmail Address [bill.childers@linuxjournal.com]:\r\n\r\nPlease enter the following 'extra' attributes\r\nto be sent with your certificate request\r\nA challenge password []:\r\nAn optional company name []:\r\nUsing configuration from \/etc\/openvpn\/easy-rsa\/openssl-1.0.0.cnf\r\nCheck that the request matches the signature\r\nSignature ok\r\nThe Subject's Distinguished Name is as follows\r\ncountryName           :PRINTABLE:'US'\r\nstateOrProvinceName   :PRINTABLE:'CA'\r\nlocalityName          :PRINTABLE:'Silicon Valley'\r\norganizationName      :PRINTABLE:'Linux Journal'\r\norganizationalUnitName:PRINTABLE:'SecTeam'\r\ncommonName            :PRINTABLE:'test.linuxjournal.com'\r\nname                  :PRINTABLE:'test.linuxjournal.com'\r\nemailAddress          :IA5STRING:'bill.childers@linuxjournal.com'\r\nCertificate is to be certified until Sep  1 06:23:59 2025 GMT (3650 days)\r\nSign the certificate? [y\/n]:y\r\n\r\n1 out of 1 certificate requests certified, commit? [y\/n]y\r\nWrite out database with 1 new entries\r\n<\/pre>\n

\u4e0b\u4e00\u6b65\u9700\u8981\u7528\u6389\u4e00\u4e9b\u65f6\u95f4\u6765\u751f\u6210 OpenVPN \u670d\u52a1\u5668\u9700\u8981\u7684 Diffie-Hellman \u5bc6\u94a5\u3002\u8fd9\u4e2a\u6b65\u9aa4\u5728\u4e00\u822c\u7684\u684c\u9762\u7ea7 CPU \u4e0a\u4f1a\u9700\u8981\u51e0\u5206\u949f\u7684\u65f6\u95f4\uff0c\u4f46\u5728 ARM \u6784\u67b6\u7684\u6811\u8393\u6d3e\u4e0a\uff0c\u4f1a\u7528\u6389\u8d85\u7ea7\u8d85\u7ea7\u957f\u7684\u65f6\u95f4\u3002\u8010\u5fc3\u70b9\uff0c\u53ea\u8981\u7ec8\u7aef\u4e0a\u7684\u70b9\u8fd8\u5728\u8df3\uff0c\u90a3\u4e48\u4e00\u5207\u5c31\u5728\u6309\u90e8\u5c31\u73ed\u8fd0\u884c\uff08\u4e0b\u9762\u7684\u793a\u4f8b\u7701\u7565\u4e86\u4e0d\u5c11\u7684\u70b9\uff09\uff1a<\/p>\n

root@test:\/etc\/openvpn\/easy-rsa# .\/build-dh\r\nGenerating DH parameters, 4096 bit long safe prime,\r\n ↪generator 2\r\nThis is going to take a long time\r\n....................................................+\r\n<\u7701\u7565\u4e86\u4e0d\u5c11\u7684\u70b9>\r\n<\/pre>\n
\u751f\u6210\u5ba2\u6237\u7aef\u8bc1\u4e66<\/strong><\/div>\n

\u73b0\u5728\u4f60\u8981\u751f\u6210\u4e00\u4e0b\u5ba2\u6237\u7aef\u7528\u4e8e\u767b\u5f55 OpenVPN \u7684\u5bc6\u94a5\u3002\u901a\u5e38\u6765\u8bf4 OpenVPN \u90fd\u4f1a\u88ab\u914d\u7f6e\u6210\u4f7f\u7528\u8bc1\u4e66\u9a8c\u8bc1\u7684\u52a0\u5bc6\u65b9\u5f0f\uff0c\u5728\u8fd9\u4e2a\u914d\u7f6e\u4e0b\u5ba2\u6237\u7aef\u9700\u8981\u6301\u6709\u7531\u670d\u52a1\u7aef\u7b7e\u53d1\u7684\u4e00\u4efd\u8bc1\u4e66\uff1a<\/p>\n

root@test:\/etc\/openvpn\/easy-rsa# .\/build-key bills-computer\r\nGenerating a 4096 bit RSA private key\r\n...................................................++\r\n...................................................++\r\nwriting new private key to 'bills-computer.key'\r\n-----\r\nYou are about to be asked to enter information that\r\nwill be incorporated into your certificate request.\r\nWhat you are about to enter is what is called a\r\nDistinguished Name or a DN. There are quite a few\r\nfields but you can leave some blank.\r\nFor some fields there will be a default value,\r\nIf you enter '.', the field will be left blank.\r\n-----\r\nCountry Name (2 letter code) [US]:\r\nState or Province Name (full name) [CA]:\r\nLocality Name (eg, city) [Silicon Valley]:\r\nOrganization Name (eg, company) [Linux Journal]:\r\nOrganizational Unit Name (eg, section) [changeme]:SecTeam\r\nCommon Name (eg, your name or your server's hostname) [bills-computer]:\r\nName [changeme]:bills-computer\r\nEmail Address [bill.childers@linuxjournal.com]:\r\n\r\nPlease enter the following 'extra' attributes\r\nto be sent with your certificate request\r\nA challenge password []:\r\nAn optional company name []:\r\nUsing configuration from \/etc\/openvpn\/easy-rsa\/openssl-1.0.0.cnf\r\nCheck that the request matches the signature\r\nSignature ok\r\nThe Subject's Distinguished Name is as follows\r\ncountryName           :PRINTABLE:'US'\r\nstateOrProvinceName   :PRINTABLE:'CA'\r\nlocalityName          :PRINTABLE:'Silicon Valley'\r\norganizationName      :PRINTABLE:'Linux Journal'\r\norganizationalUnitName:PRINTABLE:'SecTeam'\r\ncommonName            :PRINTABLE:'bills-computer'\r\nname                  :PRINTABLE:'bills-computer'\r\nemailAddress          :IA5STRING:'bill.childers@linuxjournal.com'\r\nCertificate is to be certified until Sep  1 07:35:07 2025 GMT (3650 days)\r\nSign the certificate? [y\/n]:y\r\n\r\n1 out of 1 certificate requests certified, commit? [y\/n]y\r\nWrite out database with 1 new entries\r\nData Base Updated\r\nroot@test:\/etc\/openvpn\/easy-rsa#\r\n<\/pre>\n

\u73b0\u5728\u4f60\u9700\u8981\u518d\u751f\u6210\u4e00\u4e2a HMAC \u7801\u4f5c\u4e3a\u5171\u4eab\u5bc6\u94a5\u6765\u8fdb\u4e00\u6b65\u589e\u52a0\u6574\u4e2a\u52a0\u5bc6\u63d0\u4f9b\u7684\u5b89\u5168\u6027\uff1a<\/p>\n

root@test:~# openvpn --genkey --secret \/etc\/openvpn\/easy-rsa\/keys\/ta.key\r\n<\/pre>\n
\u914d\u7f6e\u670d\u52a1\u5668<\/strong><\/div>\n

\u6700\u540e\uff0c\u6211\u4eec\u5230\u4e86\u914d\u7f6e OpenVPN \u670d\u52a1\u7684\u65f6\u5019\u4e86\u3002\u4f60\u9700\u8981\u521b\u5efa\u4e00\u4e2a \/etc\/openvpn\/server.conf \u6587\u4ef6\uff1b\u8fd9\u4e2a\u914d\u7f6e\u6587\u4ef6\u7684\u5927\u591a\u6570\u5730\u65b9\u90fd\u53ef\u4ee5\u5957\u7528\u6a21\u677f\u89e3\u51b3\u3002\u8bbe\u7f6e OpenVPN \u670d\u52a1\u7684\u4e3b\u8981\u4fee\u6539\u5728\u4e8e\u8ba9\u5b83\u53ea\u7528 TCP \u800c\u4e0d\u662f UDP \u94fe\u63a5\u3002\u8fd9\u662f\u4e0b\u4e00\u6b65\u6240\u5fc5\u9700\u7684---\u5982\u679c\u4e0d\u662f TCP \u8fde\u63a5\u90a3\u4e48\u4f60\u7684\u670d\u52a1\u5c06\u4e0d\u80fd\u5de5\u4f5c\u5728\u7aef\u53e3 443 \u4e0a\u3002\u521b\u5efa \/etc\/openvpn\/server.conf \u7136\u540e\u628a\u4e0b\u8ff0\u914d\u7f6e\u4e22\u8fdb\u53bb\uff1a<\/p>\n

port 1194\r\nproto tcp\r\ndev tun\r\nca easy-rsa\/keys\/ca.crt\r\ncert easy-rsa\/keys\/test.linuxjournal.com.crt ## or whatever your hostname was\r\nkey easy-rsa\/keys\/test.linuxjournal.com.key  ## Hostname key- This file should be kept secret\r\nmanagement localhost 7505\r\ndh easy-rsa\/keys\/dh4096.pem\r\ntls-auth \/etc\/openvpn\/certs\/ta.key 0\r\nserver 10.8.0.0 255.255.255.0 # The server will use this subnet for clients connecting to it\r\nifconfig-pool-persist ipp.txt\r\npush \"redirect-gateway def1 bypass-dhcp\" # Forces clients to redirect all traffic through the VPN\r\npush \"dhcp-option DNS 192.168.1.1\" # Tells the client to use the DNS server at 192.168.1.1 for DNS - replace with the IP address of the OpenVPN machine and clients will use the BIND server setup earlier\r\nkeepalive 30 240\r\ncomp-lzo # Enable compression\r\npersist-key\r\npersist-tun\r\nstatus openvpn-status.log\r\nverb 3\r\n<\/pre>\n

\u6700\u540e\uff0c\u4f60\u5c06\u9700\u8981\u5728\u670d\u52a1\u5668\u4e0a\u542f\u7528 IP \u8f6c\u53d1\uff0c\u914d\u7f6e OpenVPN \u4e3a\u5f00\u673a\u542f\u52a8\uff0c\u5e76\u7acb\u523b\u542f\u52a8 OpenVPN \u670d\u52a1\uff1a<\/p>\n

root@test:\/etc\/openvpn\/easy-rsa\/keys# echo \"net.ipv4.ip_forward = 1\" >> \/etc\/sysctl.conf\r\nroot@test:\/etc\/openvpn\/easy-rsa\/keys# sysctl -p \/etc\/sysctl.conf\r\nnet.core.wmem_max = 12582912\r\nnet.core.rmem_max = 12582912\r\nnet.ipv4.tcp_rmem = 10240 87380 12582912\r\nnet.ipv4.tcp_wmem = 10240 87380 12582912\r\nnet.core.wmem_max = 12582912\r\nnet.core.rmem_max = 12582912\r\nnet.ipv4.tcp_rmem = 10240 87380 12582912\r\nnet.ipv4.tcp_wmem = 10240 87380 12582912\r\nnet.core.wmem_max = 12582912\r\nnet.core.rmem_max = 12582912\r\nnet.ipv4.tcp_rmem = 10240 87380 12582912\r\nnet.ipv4.tcp_wmem = 10240 87380 12582912\r\nnet.ipv4.ip_forward = 0\r\nnet.ipv4.ip_forward = 1\r\n\r\nroot@test:\/etc\/openvpn\/easy-rsa\/keys# update-rc.d openvpn defaults\r\nupdate-rc.d: using dependency based boot sequencing\r\n\r\nroot@test:\/etc\/openvpn\/easy-rsa\/keys# \/etc\/init.d\/openvpn start\r\n[ ok ] Starting virtual private network daemon:.\r\n<\/pre>\n
\u914d\u7f6e OpenVPN \u5ba2\u6237\u7aef<\/strong><\/div>\n

\u5ba2\u6237\u7aef\u7684\u5b89\u88c5\u53d6\u51b3\u4e8e\u5ba2\u6237\u7aef\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u4f46\u4f60\u9700\u8981\u5c06\u4e4b\u524d\u751f\u6210\u7684\u8bc1\u4e66\u548c\u5bc6\u94a5\u590d\u5236\u5230\u4f60\u7684\u5ba2\u6237\u7aef\u4e0a\uff0c\u5e76\u5bfc\u5165\u4f60\u7684 OpenVPN \u5ba2\u6237\u7aef\u5e76\u65b0\u5efa\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\u3002\u6bcf\u79cd\u64cd\u4f5c\u7cfb\u7edf\u4e0b\u7684 OpenVPN \u5ba2\u6237\u7aef\u5728\u64cd\u4f5c\u4e0a\u4f1a\u6709\u4e9b\u7a0d\u8bb8\u4e0d\u540c\uff0c\u8fd9\u4e5f\u4e0d\u5728\u8fd9\u7bc7\u6587\u7ae0\u7684\u8986\u76d6\u8303\u56f4\u5185\uff0c\u6240\u4ee5\u4f60\u6700\u597d\u53bb\u770b\u770b\u7279\u5b9a\u64cd\u4f5c\u7cfb\u7edf\u4e0b\u7684 OpenVPN \u6587\u6863\u6765\u83b7\u53d6\u66f4\u591a\u4fe1\u606f\u3002\u8bf7\u53c2\u8003\u672c\u6587\u6863\u91cc\u7684\u8d44\u6e90\u90a3\u4e00\u8282\u3002<\/p>\n

\u5b89\u88c5 SSLH \u2014\u2014 \"\u9b54\u6cd5\"\u591a\u534f\u8bae\u5207\u6362\u5de5\u5177<\/strong><\/div>\n

\u672c\u6587\u7ae0\u4ecb\u7ecd\u7684\u89e3\u51b3\u65b9\u6848\u6700\u6709\u8da3\u7684\u90e8\u5206\u5c31\u662f\u8fd0\u7528 SSLH \u4e86\u3002SSLH \u662f\u4e00\u4e2a\u591a\u91cd\u534f\u8bae\u5de5\u5177\u2014\u2014\u5b83\u53ef\u4ee5\u76d1\u542c 443 \u7aef\u53e3\u7684\u6d41\u91cf\uff0c\u7136\u540e\u5206\u6790\u4ed6\u4eec\u662f SSH\uff0cHTTPS \u8fd8\u662f OpenVPN \u7684\u901a\u8baf\u5305\uff0c\u5e76\u628a\u5b83\u4eec\u5206\u522b\u8f6c\u53d1\u7ed9\u6b63\u786e\u7684\u7cfb\u7edf\u670d\u52a1\u3002\u8fd9\u5c31\u662f\u4e3a\u4f55\u672c\u89e3\u51b3\u65b9\u6848\u53ef\u4ee5\u8ba9\u4f60\u7ed5\u8fc7\u5927\u591a\u6570\u7aef\u53e3\u5c01\u6740\u2014\u2014\u4f60\u53ef\u4ee5\u4e00\u76f4\u4f7f\u7528 HTTPS \u901a\u8baf\uff0c\u56e0\u4e3a\u5b83\u51e0\u4e4e\u4ece\u6765\u4e0d\u4f1a\u88ab\u5c01\u6740\u3002<\/p>\n

\u540c\u6837\uff0c\u76f4\u63a5 apt-get \u5b89\u88c5\uff1a<\/p>\n

\r\nroot@test:\/etc\/openvpn\/easy-rsa\/keys# apt-get install sslh\r\nReading package lists... Done\r\nBuilding dependency tree\r\nReading state information... Done\r\nThe following extra packages will be installed:\r\n  apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common\r\n  libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libconfig9\r\nSuggested packages:\r\n  apache2-doc apache2-suexec apache2-suexec-custom openbsd-inetd inet-superserver\r\nThe following NEW packages will be installed:\r\n  apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common\r\n  libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libconfig9 sslh\r\n0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.\r\nNeed to get 1,568 kB of archives.\r\nAfter this operation, 5,822 kB of additional disk space will be used.\r\nDo you want to continue [Y\/n]? y\r\n<\/pre>\n

\u5728 SSLH \u88ab\u5b89\u88c5\u4e4b\u540e\uff0c\u5305\u7ba1\u7406\u5668\u4f1a\u8be2\u95ee\u8981\u5728 inetd \u8fd8\u662f standalone \u6a21\u5f0f\u4e0b\u5141\u8bb8\u3002\u9009\u62e9 standalone \u6a21\u5f0f\uff0c\u56e0\u4e3a\u4f60\u5e0c\u671b SSLH \u5728\u5b83\u81ea\u5df1\u7684\u8fdb\u7a0b\u91cc\u8fd0\u884c\u3002\u5982\u679c\u4f60\u6ca1\u6709\u5b89\u88c5 Apache\uff0capt \u5305\u7ba1\u7406\u5668\u4f1a\u81ea\u52a8\u5e2e\u4f60\u4e0b\u8f7d\u5e76\u5b89\u88c5\u7684\uff0c\u5c3d\u7ba1\u5b83\u4e5f\u4e0d\u662f\u5b8c\u5168\u4e0d\u53ef\u6216\u7f3a\u3002\u5982\u679c\u4f60\u5df2\u7ecf\u6709 Apache \u4e86\uff0c\u90a3\u4f60\u9700\u8981\u786e\u4fdd\u5b83\u53ea\u76d1\u542c localhost \u7aef\u53e3\u800c\u4e0d\u662f\u6240\u6709\u7684\u7aef\u53e3\uff08\u4e0d\u7136\u7684\u8bdd SSLH \u4f1a\u65e0\u6cd5\u8fd0\u884c\uff0c\u56e0\u4e3a 443 \u7aef\u53e3\u5df2\u7ecf\u88ab Apache \u76d1\u542c\u5360\u7528\uff09\u3002\u5b89\u88c5\u540e\uff0c\u4f60\u4f1a\u770b\u5230\u4e00\u4e2a\u5982\u4e0b\u6240\u793a\u7684\u9519\u8bef\u4fe1\u606f\uff1a<\/p>\n

[....] Starting ssl\/ssh multiplexer: sslhsslh disabled, please adjust the configuration to your needs\r\n[FAIL] and then set RUN to 'yes' in \/etc\/default\/sslh to enable it. ... failed!\r\nfailed!\r\n<\/pre>\n

\u8fd9\u5176\u5b9e\u5e76\u4e0d\u662f\u9519\u8bef\u4fe1\u606f\uff0c\u53ea\u662f SSLH \u5728\u63d0\u9192\u4f60\u5b83\u8fd8\u672a\u88ab\u914d\u7f6e\u6240\u4ee5\u65e0\u6cd5\u542f\u52a8\uff0c\u8fd9\u5f88\u6b63\u5e38\u3002\u914d\u7f6e SSLH \u76f8\u5bf9\u6765\u8bf4\u6bd4\u8f83\u7b80\u5355\u3002\u5b83\u7684\u914d\u7f6e\u6587\u4ef6\u653e\u7f6e\u5728 \/etc\/default\/sslh\uff0c\u4f60\u53ea\u9700\u8981\u4fee\u6539 RUN \u548c DAEMON_OPTS \u53d8\u91cf\u5c31\u53ef\u4ee5\u4e86\u3002\u6211\u7684 SSLH \u914d\u7f6e\u6587\u4ef6\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

# Default options for sslh initscript\r\n# sourced by \/etc\/init.d\/sslh\r\n\r\n# Disabled by default, to force yourself\r\n# to read the configuration:\r\n# - \/usr\/share\/doc\/sslh\/README.Debian (quick start)\r\n# - \/usr\/share\/doc\/sslh\/README, at \"Configuration\" section\r\n# - sslh(8) via \"man sslh\" for more configuration details.\r\n# Once configuration ready, you *must* set RUN to yes here\r\n# and try to start sslh (standalone mode only)\r\n\r\nRUN=yes\r\n\r\n# binary to use: forked (sslh) or single-thread (sslh-select) version\r\nDAEMON=\/usr\/sbin\/sslh\r\n\r\nDAEMON_OPTS=\"--user sslh --listen 0.0.0.0:443 --ssh 127.0.0.1:22 --ssl 127.0.0.1:443 --openvpn 127.0.0.1:1194 --pidfile \/var\/run\/sslh\/sslh.pid\"\r\n<\/pre>\n

\u4fdd\u5b58\u7f16\u8f91\u5e76\u542f\u52a8 SSLH\uff1a<\/p>\n

root@test:\/etc\/openvpn\/easy-rsa\/keys# \/etc\/init.d\/sslh start\r\n[ ok ] Starting ssl\/ssh multiplexer: sslh.\r\n<\/pre>\n

\u73b0\u5728\u4f60\u5e94\u8be5\u53ef\u4ee5\u4ece 443 \u7aef\u53e3 ssh \u5230\u4f60\u7684\u6811\u8393\u6d3e\u4e86\uff0c\u5b83\u4f1a\u6b63\u786e\u5730\u4f7f\u7528 SSLH \u8f6c\u53d1\uff1a<\/p>\n

$ ssh -p 443 root@test.linuxjournal.com\r\nroot@test:~#\r\n<\/pre>\n

SSLH \u73b0\u5728\u5f00\u59cb\u76d1\u542c\u7aef\u53e3 443 \u5e76\u4e14\u53ef\u4ee5\u8f6c\u53d1\u6d41\u91cf\u4fe1\u606f\u5230 SSH\u3001Apache \u6216\u8005 OpenVPN \uff0c\u8fd9\u53d6\u51b3\u4e8e\u62b5\u8fbe\u6d41\u91cf\u5305\u7684\u7c7b\u578b\u3002\u8fd9\u5957\u7cfb\u7edf\u73b0\u5df2\u6574\u88c5\u5f85\u53d1\u4e86\uff01<\/p>\n

\u7ed3\u8bba<\/strong><\/div>\n

\u73b0\u5728\u4f60\u53ef\u4ee5\u542f\u52a8 OpenVPN \u5e76\u4e14\u914d\u7f6e\u4f60\u7684\u5ba2\u6237\u7aef\u8fde\u63a5\u5230\u670d\u52a1\u5668\u7684 443 \u7aef\u53e3\u4e86\uff0c\u7136\u540e SSLH \u4f1a\u4ece\u90a3\u91cc\u628a\u6d41\u91cf\u8f6c\u53d1\u5230\u670d\u52a1\u5668\u7684 1194 \u7aef\u53e3\u3002\u4f46\u9274\u4e8e\u4f60\u6b63\u5728\u548c\u670d\u52a1\u5668\u7684 443 \u7aef\u53e3\u901a\u4fe1\uff0c\u4f60\u7684 VPN \u6d41\u91cf\u4e0d\u4f1a\u88ab\u5c01\u9501\u3002\u73b0\u5728\u4f60\u53ef\u4ee5\u8212\u670d\u5730\u5750\u5728\u964c\u751f\u5c0f\u9547\u7684\u5496\u5561\u5e97\u91cc\uff0c\u7545\u901a\u65e0\u963b\u5730\u901a\u8fc7\u4f60\u7684\u6811\u8393\u6d3e\u4e0a\u7684 OpenVPN \u6d4f\u89c8\u4e92\u8054\u7f51\u3002\u4f60\u987a\u4fbf\u8fd8\u7ed9\u4f60\u7684\u94fe\u63a5\u589e\u52a0\u4e86\u4e00\u4e9b\u5b89\u5168\u6027\uff0c\u8fd9\u4e2a\u989d\u5916\u4f5c\u7528\u4e5f\u4f1a\u8ba9\u4f60\u7684\u94fe\u63a5\u66f4\u5b89\u5168\u548c\u79c1\u5bc6\u4e00\u4e9b\u3002\u4eab\u53d7\u901a\u8fc7\u5b89\u5168\u8df3\u677f\u6d4f\u89c8\u4e92\u8054\u7f51\u628a\uff01<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-7556-1.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/securi-pi.html<\/a>\u6765\u6e90\uff1aLinux\u4e2d\u56fd\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u50cf\u5f88\u591a LinuxJournal \u7684\u8bfb\u8005\u4e00\u6837\uff0c\u6211\u4e5f\u8fc7\u4e0a\u4e86\u5f53\u4eca\u975e\u5e38\u666e\u904d\u7684“\u79d1\u6280\u6e38\u7267”\u751f\u6d3b\uff0c\u5728\u7f51\u7edc\u4e4b\u95f4\uff0c\u4ece\u4e00\u4e2a\u63a5\u5165\u70b9\u5230\u53e6\u4e00\u4e2a\u63a5\u5165\u70b9\uff0c\u6211\u4eec\u8eab\u5904\u73b0\u5b9e\u4e16\u754c\u7684\u4e0d\u540c\u5730\u65b9\u5374\u59cb\u7ec8\u4fdd\u6301\u8fde\u63a5\u5230\u4e92\u8054\u7f51\u548c\u65e5\u5e38\u4f7f\u7528\u7684\u5176\u5b83\u7f51\u7edc\u4e0a\u3002\u8fd1\u6765\u6211\u53d1\u73b0\u8d8a\u6765\u8d8a\u591a\u7684\u7f51\u7edc\u73af\u5883\u5f00\u59cb\u5c4f\u853d\u5bf9\u5916\u7684\u5e38\u7528\u7aef\u53e3\u6bd4\u5982 SMTP\uff08\u7aef\u53e3 25\uff09\uff0cSSH\uff08\u7aef\u53e3 22\uff09\u4e4b\u7c7b\u7684\u3002\u5f53\u4f60\u8d70\u8fdb\u4e00\u5bb6\u5496\u5561\u9986\u7136\u540e\u60f3 SSH \u5230\u4f60\u7684\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u505a\u70b9\u4e8b\u60c5\u7684\u65f6\u5019\u53d1\u73b0\u7aef\u53e3 22 \u88ab\u5c4f\u853d\u4e86\u662f\u4e00\u4ef6\u5f88\u70e6\u7684\u4e8b\u60c5\u3002<\/p>\n","protected":false},"author":309,"featured_media":21690,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-21261","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/21261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/309"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=21261"}],"version-history":[{"count":11,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/21261\/revisions"}],"predecessor-version":[{"id":256143,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/21261\/revisions\/256143"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/21690"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=21261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=21261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=21261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}