{"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":"
\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 \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 <\/p>\n \u56fe 1 \u6811\u8393\u6d3e\uff0c\u5373\u5c06\u6210\u4e3a\u6211\u4eec\u7684\u52a0\u5bc6\u7f51\u7edc\u7aef\u70b9<\/em><\/p>\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 \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 \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 \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 \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 \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 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 \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 \u4e0b\u4e00\u6b65\uff0c\u628a vars \u6587\u4ef6\u590d\u5236\u4e00\u4e2a\u5907\u4efd\uff1a<\/p>\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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \u4fdd\u5b58\u7f16\u8f91\u5e76\u542f\u52a8 SSLH\uff1a<\/p>\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 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 \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 \u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-7556-1.html<\/a><\/p>\n |