{"id":690,"date":"2025-02-23T19:45:16","date_gmt":"2025-02-23T16:45:16","guid":{"rendered":"https:\/\/gerdlezhev.ru\/?p=690"},"modified":"2025-02-24T21:33:29","modified_gmt":"2025-02-24T18:33:29","slug":"%d0%ba%d0%b0%d0%ba-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%b0%d0%b5%d1%82-fail2ban-%d0%b7%d0%b0%d1%89%d0%b8%d1%82%d0%b0-%d0%b2%d0%b0%d1%88%d0%b5%d0%b3%d0%be-%d1%81%d0%b5%d1%80%d0%b2%d0%b5%d1%80%d0%b0","status":"publish","type":"post","link":"https:\/\/gerdlezhev.ru\/?p=690","title":{"rendered":"\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Fail2Ban: \u0417\u0430\u0449\u0438\u0442\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043e\u0442 \u0430\u0442\u0430\u043a"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/Flux_Dev_A_futuristic_hightech_illustration_of_a_laptop_screen_1-1024x1024.jpeg\" alt=\"\" class=\"wp-image-691\" srcset=\"https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/Flux_Dev_A_futuristic_hightech_illustration_of_a_laptop_screen_1-1024x1024.jpeg 1024w, https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/Flux_Dev_A_futuristic_hightech_illustration_of_a_laptop_screen_1-300x300.jpeg 300w, https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/Flux_Dev_A_futuristic_hightech_illustration_of_a_laptop_screen_1-150x150.jpeg 150w, https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/Flux_Dev_A_futuristic_hightech_illustration_of_a_laptop_screen_1-768x768.jpeg 768w, https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/Flux_Dev_A_futuristic_hightech_illustration_of_a_laptop_screen_1.jpeg 1120w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">\u0413\u0435\u0440\u0434\u043b\u0435\u0436\u0435\u0432 \u0412\u0438\u0442\u0430\u043b\u0438\u0439 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 fail2ban<\/figcaption><\/figure>\n\n\n\n<p><br><strong>Fail2Ban<\/strong> \u2014 \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043e\u0442 bruteforce-\u0430\u0442\u0430\u043a, \u0441\u043a\u0430\u043d\u0435\u0440\u043e\u0432 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u041e\u043d \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043b\u043e\u0433\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0433\u0440\u043e\u0437\u044b \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Fail2Ban, \u0438\u0437 \u043a\u0430\u043a\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c. \u042f \u0435\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u043b \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 SFTP, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043b\u044e\u0447\u0430\u043c\u0438, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Fail2Ban?<\/h2>\n\n\n\n<p>Fail2Ban \u2014 \u044d\u0442\u043e \u0434\u0435\u043c\u043e\u043d (\u0444\u043e\u043d\u043e\u0432\u0430\u044f \u0441\u043b\u0443\u0436\u0431\u0430), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043b\u043e\u0433\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u041f\u0440\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0432\u0445\u043e\u0434\u0430) \u043e\u043d \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 IP-\u0430\u0434\u0440\u0435\u0441 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u0430 (iptables, ufw, firewalld \u0438 \u0434\u0440.). \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0440\u0438\u0441\u043a \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u0430\u0442\u0430\u043a \u043d\u0430 \u0442\u0430\u043a\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043a\u0430\u043a SSH, FTP, \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u044b (Apache, Nginx) \u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/bdS3aTB0QLa2-yHEcOhzNA.webp\" alt=\"\" class=\"wp-image-692\" srcset=\"https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/bdS3aTB0QLa2-yHEcOhzNA.webp 1024w, https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/bdS3aTB0QLa2-yHEcOhzNA-300x300.webp 300w, https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/bdS3aTB0QLa2-yHEcOhzNA-150x150.webp 150w, https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/bdS3aTB0QLa2-yHEcOhzNA-768x768.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0430\u0431\u043e\u0442\u044b Fail2Ban<\/h2>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u0410\u043d\u0430\u043b\u0438\u0437 \u043b\u043e\u0433\u043e\u0432<\/h3>\n\n\n\n<p>Fail2Ban \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u043b\u043e\u0433\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/var\/log\/auth.log<\/code> \u0434\u043b\u044f SSH;<\/li>\n\n\n\n<li><code>\/var\/log\/apache2\/access.log<\/code> \u0434\u043b\u044f Apache;<\/li>\n\n\n\n<li><code>\/var\/log\/nginx\/access.log<\/code> \u0434\u043b\u044f Nginx.<\/li>\n<\/ul>\n\n\n\n<p>\u041e\u043d \u0438\u0449\u0435\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0430\u0442\u0430\u043a\u0430\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f (regex). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u0445 \u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u0424\u0438\u043b\u044c\u0442\u0440\u044b \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430<\/h3>\n\n\n\n<p>\u041a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0438\u043f\u0443 \u0430\u0442\u0430\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 <strong>\u0444\u0438\u043b\u044c\u0442\u0440<\/strong> \u2014 \u0444\u0430\u0439\u043b \u0441 regex-\u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0438\u043b\u044c\u0442\u0440 \u0434\u043b\u044f SSH \u043c\u043e\u0436\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Failed password for invalid user .* from &lt;HOST&gt;\nFailed password for .* from &lt;HOST&gt;<\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 Fail2Ban \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0434\u043b\u044f IP-\u0430\u0434\u0440\u0435\u0441\u0430 (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>&lt;HOST&gt;<\/code> \u0432 \u043b\u043e\u0433\u0435).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Jail (\u0422\u044e\u0440\u044c\u043c\u044b)<\/h3>\n\n\n\n<p><strong>Jail<\/strong> \u2014 \u044d\u0442\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u041a\u0430\u043a\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c.<\/li>\n\n\n\n<li>\u041a\u0430\u043a\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 10 \u043c\u0438\u043d\u0443\u0442).<\/li>\n\n\n\n<li>\u0421\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u0434\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 (maxretry).<\/li>\n\n\n\n<li>\u0412\u0440\u0435\u043c\u044f \u0431\u0430\u043d\u0430 (bantime).<\/li>\n\n\n\n<li>\u041c\u0435\u0442\u043e\u0434 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 (\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432 \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u0435).<\/li>\n<\/ul>\n\n\n\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 jail \u0434\u043b\u044f SSH:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;sshd]\nenabled = true\nport = ssh\nfilter = sshd\nlogpath = \/var\/log\/auth.log\nmaxretry = 3\nfindtime = 300\nbantime = 3600<\/code><\/pre>\n\n\n\n<p>\u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442: \u0435\u0441\u043b\u0438 \u0437\u0430 5 \u043c\u0438\u043d\u0443\u0442 (300 \u0441\u0435\u043a\u0443\u043d\u0434) \u0431\u0443\u0434\u0435\u0442 3 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0432\u0445\u043e\u0434\u0430, IP \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0442 \u043d\u0430 1 \u0447\u0430\u0441.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f (Actions)<\/h3>\n\n\n\n<p>\u041f\u0440\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u0430\u0432\u0438\u043b Fail2Ban \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 <strong>\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 iptables\/nftables.<\/li>\n\n\n\n<li>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443.<\/li>\n\n\n\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 IP \u0432 \u0447\u0435\u0440\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a.<\/li>\n<\/ul>\n\n\n\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 <code>\/etc\/fail2ban\/action.d\/<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>iptables-allports.conf<\/code> \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0435 \u043f\u043e\u0440\u0442\u044b \u0434\u043b\u044f \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u0435\u043b\u044f.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b Fail2Ban<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u0424\u0438\u043b\u044c\u0442\u0440\u044b<\/strong> (\u0432 <code>\/etc\/fail2ban\/filter.d\/<\/code>) \u2014 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442, \u043a\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043b\u043e\u0433\u0430\u0445 \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u0430\u0442\u0430\u043a\u043e\u0439.<\/li>\n\n\n\n<li><strong>Jail.conf<\/strong> (\u0438 jail.local) \u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u00ab\u0442\u044e\u0440\u0435\u043c\u00bb (\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b).<\/li>\n\n\n\n<li><strong>Action.d<\/strong> \u2014 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u043e\u043c \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/li>\n\n\n\n<li><strong>Fail2Ban-server<\/strong> \u2014 \u0434\u0435\u043c\u043e\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b SSH<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 Fail2Ban:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo apt install fail2ban  # \u0414\u043b\u044f Debian\/Ubuntu<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f SSH:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo cp \/etc\/fail2ban\/jail.conf \/etc\/fail2ban\/jail.local<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>\u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 <code>\/etc\/fail2ban\/jail.local<\/code>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   &#91;sshd]\n   enabled = true\n   maxretry = 3\n   findtime = 600\n   bantime = 86400<\/code><\/pre>\n\n\n\n<p>\u042d\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430 24 \u0447\u0430\u0441\u0430 \u043f\u043e\u0441\u043b\u0435 3 \u043e\u0448\u0438\u0431\u043e\u043a \u0437\u0430 10 \u043c\u0438\u043d\u0443\u0442.<\/p>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 Fail2Ban:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo systemctl restart fail2ban<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u0421\u043e\u0432\u0435\u0442\u044b \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0442\u0430\u0442\u0443\u0441\u0430:<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo fail2ban-client status sshd<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u043a\u0430\u0436\u0435\u0442 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430.<\/p>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u0420\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 IP:<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo fail2ban-client set sshd unbanip 192.168.1.100<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b:<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>ignoreip<\/code> \u0432 jail.local, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0435 IP.<\/li>\n\n\n\n<li>\u0414\u043b\u044f \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u043f\u0440\u043e\u0442\u0438\u0432 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u0438\u043b\u0438 SQL-\u0438\u043d\u044a\u0435\u043a\u0446\u0438\u0439.<\/li>\n<\/ul>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433:<\/strong><br>\u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435 \u043b\u043e\u0433\u0438 Fail2Ban (<code>\/var\/log\/fail2ban.log<\/code>) \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Fail2Ban<\/strong> \u043d\u0435 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 DDoS-\u0430\u0442\u0430\u043a \u0438\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0430\u0442\u0430\u043a.<\/li>\n\n\n\n<li>\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b: <strong>CrowdSec<\/strong> (\u043e\u0431\u043b\u0430\u0447\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430), <strong>Firewalld<\/strong> \u0441 Rich Rules.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n\n\n\n<p>Fail2Ban \u2014 \u044d\u0442\u043e \u0433\u0438\u0431\u043a\u0438\u0439 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0415\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u0430, \u043d\u043e \u0434\u0430\u0436\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043d\u0438\u0436\u0430\u044e\u0442 \u0440\u0438\u0441\u043a \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u0430\u0442\u0430\u043a. \u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0439\u0442\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435 \u043b\u043e\u0433\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0448\u0430\u0433 \u0432\u043f\u0435\u0440\u0435\u0434\u0438 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u043e\u0432.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" data-id=\"693\" src=\"https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/r_9pY4QuTlqUqchzp5y1gw.webp\" alt=\"\" class=\"wp-image-693\" srcset=\"https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/r_9pY4QuTlqUqchzp5y1gw.webp 1024w, https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/r_9pY4QuTlqUqchzp5y1gw-300x300.webp 300w, https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/r_9pY4QuTlqUqchzp5y1gw-150x150.webp 150w, https:\/\/gerdlezhev.ru\/wp-content\/uploads\/2025\/02\/r_9pY4QuTlqUqchzp5y1gw-768x768.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><strong>\u0417\u0430\u0449\u0438\u0442\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u044d\u0442\u043e \u043e\u0431\u0440\u0430\u0437 \u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f.<\/strong> \u0413\u0435\u0440\u0434\u043b\u0435\u0436\u0435\u0432 \u0412\u0438\u0442\u0430\u043b\u0438\u0439<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fail2Ban \u2014 \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043e\u0442 bruteforce-\u0430\u0442\u0430\u043a, \u0441\u043a\u0430\u043d\u0435\u0440\u043e\u0432 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u041e\u043d \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043b\u043e\u0433\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0433\u0440\u043e\u0437\u044b \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Fail2Ban, \u0438\u0437 \u043a\u0430\u043a\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c. \u042f \u0435\u0433\u043e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-690","post","type-post","status-publish","format-standard","hentry","category-2"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/gerdlezhev.ru\/index.php?rest_route=\/wp\/v2\/posts\/690","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gerdlezhev.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gerdlezhev.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gerdlezhev.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gerdlezhev.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=690"}],"version-history":[{"count":1,"href":"https:\/\/gerdlezhev.ru\/index.php?rest_route=\/wp\/v2\/posts\/690\/revisions"}],"predecessor-version":[{"id":694,"href":"https:\/\/gerdlezhev.ru\/index.php?rest_route=\/wp\/v2\/posts\/690\/revisions\/694"}],"wp:attachment":[{"href":"https:\/\/gerdlezhev.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=690"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gerdlezhev.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=690"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gerdlezhev.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}