{"id":130526,"date":"2020-07-04T01:35:45","date_gmt":"2020-07-03T17:35:45","guid":{"rendered":"http:\/\/4563.org\/?p=130526"},"modified":"2020-07-04T01:35:45","modified_gmt":"2020-07-03T17:35:45","slug":"vps%e5%ae%89%e5%85%a8%e5%8a%a0%e5%9b%ba","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=130526","title":{"rendered":"VPS\u5b89\u5168\u52a0\u56fa"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>Alanku<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>VPS\u5b89\u5168\u52a0\u56fa<\/h3>\n<p>  \t\t\u4e4b\u524d\u8bd5\u8fc7vps\u767b\u5f55\u4e0d\u4e0a\uff0c\u800c\u4e14ssh\u7ecf\u5e38\u6389\u7ebf\uff0c\u5f88\u7eb3\u95f7\uff0cping\u4e86\u57df\u540d\uff0c\u57df\u540d\u6ca1\u88ab\u5899\uff0c\u540e\u6765\u53d1\u73b0\uff0c\u539f\u6765\u673a\u5b50\u6b63\u5728\u88abssh\u7206\u7834\uff0c\u6700\u591a\u7684\u4e00\u4e2aip\u591a\u8fbe6000\u591a\u6b21\uff0c\u4ece\u65e9\u626b\u5230\u665a\u3002\u3002\u3002\u3002\u3002\u7136\u540e\uff0c\u6211\u5c31\u4e0a\u7f51\u641c\u7d22\u4e86\u4e00\u4e0bvps\u5b89\u5168\u52a0\u56fa\u7684\u6559\u7a0b\uff0c\u6c47\u603b\u4e00\u4e0b\u5206\u4eab\u7ed9\u5927\u5bb6\u3002\u5f53\u7136\u5566\u76f4\u63a5\u4f7f\u7528\u79d8\u94a5\u767b\u5f55\u662f\u6700\u5b89\u5168\u7684\uff0c\u6211\u8fd9\u91cc\u662f\u4e3a\u4e86\u65b9\u4fbf\uff0c\u6298\u4e2d\u4e00\u4e0b\uff0c\u5bc6\u7801\u767b\u5f55\u7684\u52a0\u56fa\u65b9\u6cd5\u3002<\/p>\n<p>  1. \u66f4\u6362ssh\u7aef\u53e3\u5e76\u542f\u7528\u5f3a\u5bc6\u7801<br \/>  &nbsp; &nbsp;passwd root<br \/>  &nbsp; &nbsp;nano \/etc\/ssh\/sshd_config<br \/>  &nbsp; &nbsp;Port = \u3010\u4f60\u7684ssh\u7aef\u53e3\u3011\u5efa\u8bae1024\u4ee5\u4e0a\u9ad8\u7aef\u53e3<br \/>  &nbsp; &nbsp;service sshd restart<\/p>\n<p>  2. \u5f00\u542f\u9632\u706b\u5899ufw\u6216\u5b89\u5168\u7b56\u7565\u7ec4<br \/>  &nbsp; &nbsp;apt install ufw<br \/>  &nbsp; &nbsp;ufw allow 80<br \/>  &nbsp; &nbsp;ufw allow 443<br \/>  &nbsp; &nbsp;ufw allow \u3010\u4f60\u7684ssh\u7aef\u53e3\u3011<br \/>  &nbsp; &nbsp;ufw default deny<br \/>  &nbsp; &nbsp;ufw enable<br \/>  &nbsp; &nbsp;ufw delete allow 80<br \/>  &nbsp; &nbsp;&#8230;<\/p>\n<p>  3. \u5b89\u88c5fail2ban\u9632\u6b62SSH\u66b4\u7834<br \/>  &nbsp; &nbsp;cd \/etc\/fail2ban<br \/>  &nbsp; &nbsp;cp jail.conf jail.local<br \/>  &nbsp; &nbsp;nano jail.local<br \/>  &nbsp; &nbsp;\u6392\u9664\u81ea\u8eabip\uff0cignoreip\u5904\u52a0\u4e0a\u81ea\u5df1\u7684ip <br \/>  &nbsp; &nbsp;sshd\u5904\u66f4\u6539\u7aef\u53e3\u4e3a\u3010\u4f60\u7684ssh\u7aef\u53e3\u3011\uff0c\u5e76\u52a0\u4e0a enabled = true<br \/>  &nbsp; &nbsp;\u7136\u540e\u542f\u52a8fail2ban\u670d\u52a1\uff0c\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<br \/>  &nbsp; &nbsp;service fail2ban restart<br \/>  &nbsp; &nbsp;systemctl enable fail2ban<br \/>  &nbsp; &nbsp;<\/p>\n<p>  4. \u5b9a\u671f\u68c0\u67e5\u767b\u5f55\u65e5\u5fd7<br \/>  &nbsp; &nbsp;cat \/var\/log\/auth.log | grep Accepted<br \/>  &nbsp; &nbsp;cat \/var\/log\/auth.log | grep Failed<\/p>\n<p>  \t\t\t\t\t<strong>mryin<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5b66\u4e60\u4e86\uff0c\u6536\u85cf\u4e86\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>llmwxt<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6536\u85cf\u4e86\uff0c\u8c22\u8c22\uff01:lol\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>jiuqimax<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5c31\u8fd9\uff1f\u6211\u88c5\u673a\u5fc5\u5907\u811a\u672c\u91cc\u8bbe\u7f6e\u9519\u4e00\u6b21\u5bc6\u7801\u5c31\u5c01ip\u4e03\u5929\uff0c\u4e00\u70b9\u90fd\u4e0d\u614c\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Alanku \u5927\u4f6c\u6709\u8bdd\u8bf4 : VP&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/130526"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=130526"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/130526\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=130526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=130526"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=130526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}