{"id":1471,"date":"2019-03-09T23:29:13","date_gmt":"2019-03-09T15:29:13","guid":{"rendered":"https:\/\/pjq.me\/?p=1471"},"modified":"2019-03-11T23:32:27","modified_gmt":"2019-03-11T15:32:27","slug":"fail2ban%e6%97%a0%e6%b3%95%e5%90%af%e5%8a%a8","status":"publish","type":"post","link":"https:\/\/pjq.me\/?p=1471","title":{"rendered":"Fail2Ban\u542f\u52a8\u5931\u8d25\u539f\u56e0\u5206\u6790"},"content":{"rendered":"\n<p>\u597d\u4e45\u6ca1\u6709\u68c0\u67e5Fail2Ban\u90ae\u4ef6\uff0c\u7ffb\u4e86GMail, \u624d\u53d1\u73b0\u5176\u5b9e\u65e9\u57282018\u5e7411\u6708\u4efd, Fail2Ban\u5c31\u6ca1\u6709\u6b63\u5e38\u5de5\u4f5c\u4e86\u3002<\/p>\n\n\n\n<p>\u7528\u4e0b\u9762\u4e24\u4e2a\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u7684\u4e00\u4e9b\u72b6\u6001<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status fail2ban.service\njournalctl -xe<\/code><\/pre>\n\n\n\n<!--more-->\n\n\n\n<p>\u540e\u6765\u627e\u5230\u624b\u5de5\u542f\u52a8\u7684\u547d\u4ee4\uff1a \/usr\/bin\/fail2ban-client -v -v start\uff0c\u627e\u5230\u4e0b\u9762\u7684\u9519\u8bef<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ERROR  Failed during configuration: While reading from '\/etc\/fail2ban\/jail.local' [line 146]: option 'port' in section 'pam-generic' already exists<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -A 8 \"pam\" \/etc\/fail2ban\/jail.local<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># pam-generic filter can be customized to monitor specific subset of 'tty's\nfilter   = pam-generic\n# port actually must be irrelevant but lets leave it all for some possible uses\nport     = all\nbanaction = iptables-allports\nport     = anyport\nlogpath  = \/var\/log\/auth.log\nmaxretry = 6<\/code><\/pre>\n\n\n\n<p>\u786e\u5b9e\u5b58\u5728\u4e24\u4e2aport, \u628aport     = anyport\u6ce8\u91ca\u6389\uff0c\u518d\u8dd1\u4e0a\u9762\u7684\u547d\u4ee4\u5c31\u4e00\u5207\u6b63\u5e38\u4e86. \u5728github\u4e0a\u4e5f\u627e\u5230\u4e86\u5bf9\u5e94\u7684\u8fd9\u4e2a\u95ee\u9898\uff1ahttps:\/\/github.com\/fail2ban\/fail2ban\/issues\/1396<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u518d\u6b21\u542f\u52a8\u53d1\u73b0\u8fd8\u662f\u9519\u8bef<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart fail2ban.service\nJob for fail2ban.service failed because the control process exited with error code. See \"systemctl status fail2ban.service\" and \"journalctl -xe\" for details.<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status fail2ban.service\n\u25cf fail2ban.service - Fail2Ban Service\n   Loaded: loaded (\/lib\/systemd\/system\/fail2ban.service; enabled; vendor preset: enabled)\n   Active: failed (Result: start-limit-hit) since Sat 2019-03-09 22:46:50 CST; 6min ago\n     Docs: man:fail2ban(1)\n  Process: 11913 ExecStart=\/usr\/bin\/fail2ban-client -x start (code=exited, status=255)\n\nMar 09 22:46:50 new.pjq.me systemd[1]: fail2ban.service: Control process exited, code=exited status=2\nMar 09 22:46:50 new.pjq.me systemd[1]: Failed to start Fail2Ban Service.\nMar 09 22:46:50 new.pjq.me systemd[1]: fail2ban.service: Unit entered failed state.\nMar 09 22:46:50 new.pjq.me systemd[1]: fail2ban.service: Failed with result 'exit-code'.\nMar 09 22:46:50 new.pjq.me systemd[1]: fail2ban.service: Service hold-off time over, scheduling resta\nMar 09 22:46:50 new.pjq.me systemd[1]: Stopped Fail2Ban Service.\nMar 09 22:46:50 new.pjq.me systemd[1]: fail2ban.service: Start request repeated too quickly.\nMar 09 22:46:50 new.pjq.me systemd[1]: Failed to start Fail2Ban Service.\nMar 09 22:46:50 new.pjq.me systemd[1]: fail2ban.service: Unit entered failed state.\nMar 09 22:46:50 new.pjq.me systemd[1]: fail2ban.service: Failed with result 'start-limit-hit'.<\/code><\/pre>\n\n\n\n<p>\u540e\u6765\u6253\u5230Fail2Ban github\u4e3b\u9875\uff1ahttps:\/\/github.com\/fail2ban\/fail2ban , \u5176\u5b9e\u53ef\u4ee5\u76f4\u63a5\u7528\u5b9e\u9645\u7a0b\u5e8f \/usr\/bin\/fail2ban-client \u542f\u52a8\uff0c\u5173\u95ed\uff0c\u8fd8\u5728\u72b6\u6001\u67e5\u8be2<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> \/usr\/bin\/fail2ban-client -v -v start\n \/usr\/bin\/fail2ban-client status\n \/usr\/bin\/fail2ban-client reload<\/code><\/pre>\n\n\n\n<p>\u6700\u540e\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u4efb\u4e00\u547d\u4ee4\u91cd\u542fFail2Ban\u670d\u52a1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo service fail2ban restart\nsudo systemctl restart fail2ban.service\nsudo \/etc\/init.d\/fail2ban restart<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u597d\u4e45\u6ca1\u6709\u68c0\u67e5Fail2Ban\u90ae\u4ef6\uff0c\u7ffb\u4e86GMail, \u624d\u53d1\u73b0\u5176\u5b9e\u65e9\u57282018\u5e7411\u6708\u4efd, Fail2Ban\u5c31\u6ca1\u6709\u6b63\u5e38\u5de5\u4f5c\u4e86\u3002 \u7528\u4e0b\u9762\u4e24\u4e2a\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u7684\u4e00\u4e9b\u72b6\u6001<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[169],"tags":[173,89],"class_list":["post-1471","post","type-post","status-publish","format-standard","hentry","category-tech","tag-fail2ban","tag-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Fail2Ban\u542f\u52a8\u5931\u8d25\u539f\u56e0\u5206\u6790 - Jianqing&#039;s Blog<\/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:\/\/pjq.me\/?p=1471\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fail2Ban\u542f\u52a8\u5931\u8d25\u539f\u56e0\u5206\u6790 - Jianqing&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"\u597d\u4e45\u6ca1\u6709\u68c0\u67e5Fail2Ban\u90ae\u4ef6\uff0c\u7ffb\u4e86GMail, \u624d\u53d1\u73b0\u5176\u5b9e\u65e9\u57282018\u5e7411\u6708\u4efd, Fail2Ban\u5c31\u6ca1\u6709\u6b63\u5e38\u5de5\u4f5c\u4e86\u3002 \u7528\u4e0b\u9762\u4e24\u4e2a\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u7684\u4e00\u4e9b\u72b6\u6001\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pjq.me\/?p=1471\" \/>\n<meta property=\"og:site_name\" content=\"Jianqing&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-09T15:29:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-11T15:32:27+00:00\" \/>\n<meta name=\"author\" content=\"pengjianqing\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pengjianqing\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/pjq.me\/?p=1471#article\",\"isPartOf\":{\"@id\":\"https:\/\/pjq.me\/?p=1471\"},\"author\":{\"name\":\"pengjianqing\",\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\"},\"headline\":\"Fail2Ban\u542f\u52a8\u5931\u8d25\u539f\u56e0\u5206\u6790\",\"datePublished\":\"2019-03-09T15:29:13+00:00\",\"dateModified\":\"2019-03-11T15:32:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/pjq.me\/?p=1471\"},\"wordCount\":42,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\"},\"keywords\":[\"Fail2Ban\",\"Linux\"],\"articleSection\":[\"Tech\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/pjq.me\/?p=1471#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/pjq.me\/?p=1471\",\"url\":\"https:\/\/pjq.me\/?p=1471\",\"name\":\"Fail2Ban\u542f\u52a8\u5931\u8d25\u539f\u56e0\u5206\u6790 - Jianqing&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\/\/pjq.me\/#website\"},\"datePublished\":\"2019-03-09T15:29:13+00:00\",\"dateModified\":\"2019-03-11T15:32:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/pjq.me\/?p=1471#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/pjq.me\/?p=1471\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/pjq.me\/?p=1471#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/pjq.me\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fail2Ban\u542f\u52a8\u5931\u8d25\u539f\u56e0\u5206\u6790\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/pjq.me\/#website\",\"url\":\"https:\/\/pjq.me\/\",\"name\":\"Jianqing&#039;s Blog\",\"description\":\"Thoughts and Future\",\"publisher\":{\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/pjq.me\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\",\"name\":\"pengjianqing\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png\",\"contentUrl\":\"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png\",\"width\":460,\"height\":752,\"caption\":\"pengjianqing\"},\"logo\":{\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/pjq.me\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Fail2Ban\u542f\u52a8\u5931\u8d25\u539f\u56e0\u5206\u6790 - Jianqing&#039;s Blog","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:\/\/pjq.me\/?p=1471","og_locale":"en_US","og_type":"article","og_title":"Fail2Ban\u542f\u52a8\u5931\u8d25\u539f\u56e0\u5206\u6790 - Jianqing&#039;s Blog","og_description":"\u597d\u4e45\u6ca1\u6709\u68c0\u67e5Fail2Ban\u90ae\u4ef6\uff0c\u7ffb\u4e86GMail, \u624d\u53d1\u73b0\u5176\u5b9e\u65e9\u57282018\u5e7411\u6708\u4efd, Fail2Ban\u5c31\u6ca1\u6709\u6b63\u5e38\u5de5\u4f5c\u4e86\u3002 \u7528\u4e0b\u9762\u4e24\u4e2a\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u7684\u4e00\u4e9b\u72b6\u6001","og_url":"https:\/\/pjq.me\/?p=1471","og_site_name":"Jianqing&#039;s Blog","article_published_time":"2019-03-09T15:29:13+00:00","article_modified_time":"2019-03-11T15:32:27+00:00","author":"pengjianqing","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pengjianqing","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pjq.me\/?p=1471#article","isPartOf":{"@id":"https:\/\/pjq.me\/?p=1471"},"author":{"name":"pengjianqing","@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60"},"headline":"Fail2Ban\u542f\u52a8\u5931\u8d25\u539f\u56e0\u5206\u6790","datePublished":"2019-03-09T15:29:13+00:00","dateModified":"2019-03-11T15:32:27+00:00","mainEntityOfPage":{"@id":"https:\/\/pjq.me\/?p=1471"},"wordCount":42,"commentCount":0,"publisher":{"@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60"},"keywords":["Fail2Ban","Linux"],"articleSection":["Tech"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/pjq.me\/?p=1471#respond"]}]},{"@type":"WebPage","@id":"https:\/\/pjq.me\/?p=1471","url":"https:\/\/pjq.me\/?p=1471","name":"Fail2Ban\u542f\u52a8\u5931\u8d25\u539f\u56e0\u5206\u6790 - Jianqing&#039;s Blog","isPartOf":{"@id":"https:\/\/pjq.me\/#website"},"datePublished":"2019-03-09T15:29:13+00:00","dateModified":"2019-03-11T15:32:27+00:00","breadcrumb":{"@id":"https:\/\/pjq.me\/?p=1471#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pjq.me\/?p=1471"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/pjq.me\/?p=1471#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/pjq.me\/"},{"@type":"ListItem","position":2,"name":"Fail2Ban\u542f\u52a8\u5931\u8d25\u539f\u56e0\u5206\u6790"}]},{"@type":"WebSite","@id":"https:\/\/pjq.me\/#website","url":"https:\/\/pjq.me\/","name":"Jianqing&#039;s Blog","description":"Thoughts and Future","publisher":{"@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pjq.me\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60","name":"pengjianqing","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pjq.me\/#\/schema\/person\/image\/","url":"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png","contentUrl":"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png","width":460,"height":752,"caption":"pengjianqing"},"logo":{"@id":"https:\/\/pjq.me\/#\/schema\/person\/image\/"},"url":"https:\/\/pjq.me\/?author=1"}]}},"views":3484,"_links":{"self":[{"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts\/1471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1471"}],"version-history":[{"count":5,"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts\/1471\/revisions"}],"predecessor-version":[{"id":1486,"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts\/1471\/revisions\/1486"}],"wp:attachment":[{"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}