{"id":4369,"date":"2025-09-08T14:59:04","date_gmt":"2025-09-08T11:59:04","guid":{"rendered":"https:\/\/cloudvps.by\/community\/?p=4369"},"modified":"2025-09-08T14:59:25","modified_gmt":"2025-09-08T11:59:25","slug":"nastrojka-fail2ban-telegram-alerts-na-vps","status":"publish","type":"post","link":"https:\/\/cloudvps.by\/community\/nastrojka-fail2ban-telegram-alerts-na-vps\/","title":{"rendered":"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 fail2ban + Telegram alerts \u043d\u0430 VPS: \u0437\u0430\u0449\u0438\u0442\u0430 \u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u043b\u0430\u043a\u043e\u043d\u0435"},"content":{"rendered":"\n<p>\u041a\u043e\u0433\u0434\u0430 \u0442\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0448\u044c \u0441 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c <a href=\"https:\/\/cloudvps.by\/servers\/vps\/vps_server.php\" data-internallinksmanager029f6b8e52c=\"4\" title=\"VPS \u0445\u043e\u0441\u0442\u0438\u043d\u0433\">VPS<\/a>, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u043e\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/ssh\/\" data-internallinksmanager029f6b8e52c=\"197\" title=\"SSH (Secure Shell)\">SSH<\/a>-\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u0430\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0430\u0447\u0435\u043a\u0443. <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/brute-force-attack\/\" data-internallinksmanager029f6b8e52c=\"275\" title=\"Brute Force Attack (\u0411\u0440\u0443\u0442\u0444\u043e\u0440\u0441-\u0430\u0442\u0430\u043a\u0430)\">\u0411\u0440\u0443\u0442\u0444\u043e\u0440\u0441<\/a>, \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u043f\u0430\u0440\u043e\u043b\u0435\u0439, \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u2014 \u0432\u0441\u0451 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0430\u0449\u0435, \u0447\u0435\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b. \u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0430\u0442\u0430\u043a \u2014 \u044d\u0442\u043e <strong>fail2ban<\/strong>. \u0410 \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0448\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0430\u043b\u0435\u0440\u0442\u044b \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 <strong>Telegram<\/strong>, \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0451 \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 webhook. \u042f \u0442\u0430\u043a \u0438 \u0441\u0434\u0435\u043b\u0430\u043b\u0430 \u2014 \u0438 \u0434\u0435\u043b\u044e\u0441\u044c \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 fail2ban \u0438 \u0437\u0430\u0447\u0435\u043c \u043e\u043d \u043d\u0443\u0436\u0435\u043d<\/h2>\n\n\n\n<p><strong>fail2ban<\/strong> \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442 \u043b\u043e\u0433\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>\/var\/log\/auth.log<\/code>) \u0438 \u0431\u0430\u043d\u0438\u0442 <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/ip-adres\/\" data-internallinksmanager029f6b8e52c=\"204\" title=\"IP-\u0430\u0434\u0440\u0435\u0441 (Internet Protocol)\">IP<\/a>-\u0430\u0434\u0440\u0435\u0441\u0430, \u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0432 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043f\u043e\u0434\u0440\u044f\u0434 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0432\u0432\u0451\u043b \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u0445\u043e\u0434\u0430 \u043f\u043e SSH \u2014 fail2ban \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u044d\u0442\u043e\u0442 IP \u0432 <code>iptables<\/code> \u0438\u043b\u0438 <code>nftables<\/code> \u0438 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f.<\/p>\n\n\n\n<p>\ud83d\udd25 \u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0437\u0430\u0449\u0438\u0442\u0430 SSH, nginx, postfix, dovecot \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432;<\/li>\n\n\n\n<li>\u0433\u0438\u0431\u043a\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 <code>bantime<\/code>, <code>findtime<\/code>, <code>maxretry<\/code>;<\/li>\n\n\n\n<li>whitelist IP;<\/li>\n\n\n\n<li>\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Telegram, email \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439.<\/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\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 fail2ban \u043d\u0430 Ubuntu \/ Debian<\/h2>\n\n\n\n<p>\u041d\u0430 \u043c\u043e\u0451\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0441\u0442\u043e\u0438\u0442 Ubuntu 22.04, \u043d\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u043d\u0430 Debian:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt install fail2ban -y\n<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u043d \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u2014 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0437\u0430\u0449\u0438\u0442\u0430 SSH.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u0411\u0430\u0437\u043e\u0432\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 <code>\/etc\/fail2ban\/jail.local<\/code><\/h2>\n\n\n\n<p>\u0421\u043e\u0437\u0434\u0430\u0439 \u0444\u0430\u0439\u043b <code>jail.local<\/code>, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0442\u044c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 <code>jail.conf<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/fail2ban\/jail.local\n<\/code><\/pre>\n\n\n\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;DEFAULT]\nbantime = 1h\nfindtime = 10m\nmaxretry = 5\nignoreip = 127.0.0.1\/8 ::1<\/code><\/pre>\n\n\n<p>[sshd]<\/p>\n\n\n\n<p>enabled = true <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/port\/\" data-internallinksmanager029f6b8e52c=\"225\" title=\"Port (\u041f\u043e\u0440\u0442 )\">port<\/a> = ssh logpath = %(sshd_log)s backend = systemd<\/p>\n\n\n\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>bantime<\/code> \u2014 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u0438\u0442\u0441\u044f \u0431\u0430\u043d (\u043c\u043e\u0436\u043d\u043e <code>bantime = -1<\/code> \u0434\u043b\u044f \u0432\u0435\u0447\u043d\u043e\u0433\u043e);<\/li>\n\n\n\n<li><code>findtime<\/code> \u2014 \u0437\u0430 \u043a\u0430\u043a\u043e\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0438;<\/li>\n\n\n\n<li><code>maxretry<\/code> \u2014 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0434\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438;<\/li>\n\n\n\n<li><code>ignoreip<\/code> \u2014 IP, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 <strong>\u043d\u0438\u043a\u043e\u0433\u0434\u0430<\/strong> \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0431\u0430\u043d\u0435\u043d\u044b (\u0434\u043e\u0431\u0430\u0432\u044c \u0441\u0432\u043e\u0439 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439 IP \u0441\u044e\u0434\u0430!).<\/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\">\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0430\u043b\u0435\u0440\u0442\u043e\u0432 \u0432 Telegram<\/h2>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443 \u2014 <strong>\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0432 Telegram<\/strong>. \u0423\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441\u0440\u0430\u0437\u0443, \u043a\u0430\u043a \u043a\u0442\u043e-\u0442\u043e \u0441\u0442\u0443\u0447\u0438\u0442\u0441\u044f \u0432 SSH \u0438\u043b\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u0421\u043e\u0437\u0434\u0430\u0439 Telegram-\u0431\u043e\u0442\u0430<\/h3>\n\n\n\n<p>\u0417\u0430\u0439\u0434\u0438 \u0432 Telegram \u0438 \u043d\u0430\u0439\u0434\u0438 <code>@BotFather<\/code>. \u0412\u0432\u0435\u0434\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/newbot\n<\/code><\/pre>\n\n\n\n<p>\u0414\u0430\u0439 \u0438\u043c\u044f \u0438 username (\u0434\u043e\u043b\u0436\u0435\u043d \u043e\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 <code>bot<\/code>), \u043f\u043e\u043b\u0443\u0447\u0438\u0448\u044c <strong>\u0442\u043e\u043a\u0435\u043d<\/strong> \u2014 \u0441\u043e\u0445\u0440\u0430\u043d\u0438 \u0435\u0433\u043e.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u041f\u043e\u043b\u0443\u0447\u0438 \u0441\u0432\u043e\u0439 Chat ID<\/h3>\n\n\n\n<p>\u041d\u0430\u043f\u0438\u0448\u0438 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0432\u043e\u0435\u043c\u0443 \u0431\u043e\u0442\u0443 \u0438 \u043e\u0442\u043a\u0440\u043e\u0439 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/https\/\" data-internallinksmanager029f6b8e52c=\"221\" title=\"HTTPS (Hyper Text Transfer Protocol Secure)\">https<\/a>:&#47;&#47;<a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/api\/\" data-internallinksmanager029f6b8e52c=\"226\" title=\"API (Application Programming Interface)\">api<\/a>.telegram.org\/bot&lt;\u0422\u0412\u041e\u0419_\u0422\u041e\u041a\u0415\u041d&gt;\/getUpdates\n<\/code><\/pre>\n\n\n\n<p>\u0422\u0430\u043c \u0431\u0443\u0434\u0435\u0442 <code>chat.id<\/code> \u2014 \u044d\u0442\u043e \u0442\u0432\u043e\u0439 ID, \u043a\u0443\u0434\u0430 \u0441\u043b\u0430\u0442\u044c \u0430\u043b\u0435\u0440\u0442\u044b.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 action-\u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u043b\u044f fail2ban<\/h2>\n\n\n\n<p>\u0421\u043e\u0437\u0434\u0430\u0439 \u043d\u043e\u0432\u044b\u0439 action-\u0444\u0430\u0439\u043b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/fail2ban\/action.d\/telegram-ban.conf\n<\/code><\/pre>\n\n\n\n<p>\u0412\u0441\u0442\u0430\u0432\u044c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Definition]\nactionstart = echo \"fail2ban started on &lt;hostname&gt;\" | \/usr\/bin\/curl -s -X POST https:\/\/api.telegram.org\/bot&lt;TOKEN&gt;\/sendMessage -d chat_id=&lt;CHAT_ID&gt; -d text=\"fail2ban started on &lt;hostname&gt;\"\nactionstop = echo \"fail2ban stopped\" | \/usr\/bin\/curl -s -X POST https:\/\/api.telegram.org\/bot&lt;TOKEN&gt;\/sendMessage -d chat_id=&lt;CHAT_ID&gt; -d text=\"fail2ban stopped\"\nactionban = \/usr\/bin\/curl -s -X POST https:\/\/api.telegram.org\/bot&lt;TOKEN&gt;\/sendMessage -d chat_id=&lt;CHAT_ID&gt; -d text=\"\ud83d\udea8 IP &lt;ip&gt; \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d fail2ban \u043d\u0430 &lt;hostname&gt;\"\nactionunban = \/usr\/bin\/curl -s -X POST https:\/\/api.telegram.org\/bot&lt;TOKEN&gt;\/sendMessage -d chat_id=&lt;CHAT_ID&gt; -d text=\"\u2139\ufe0f IP &lt;ip&gt; \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d fail2ban\"\n<\/code><\/pre>\n\n\n\n<p>\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0435 <code>&lt;TOKEN&gt;<\/code> \u0438 <code>&lt;CHAT_ID&gt;<\/code> \u043d\u0430 \u0441\u0432\u043e\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c \u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod +x \/etc\/fail2ban\/action.d\/telegram-ban.conf\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 action \u0432 jail.local<\/h2>\n\n\n\n<p>\u0414\u043e\u043f\u0438\u0448\u0438 \u0432 <code>[sshd]<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>action = telegram-ban\n<\/code><\/pre>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 IP \u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0448\u044c Telegram-\u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u0435 \u0441 IP, \u0434\u0430\u0442\u043e\u0439 \u0438 \u0442\u0438\u043f\u043e\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f fail2ban<\/h2>\n\n\n\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c, \u0432\u043e\u0442 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo fail2ban-client status\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e jail (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, sshd):<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo fail2ban-client status sshd\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0420\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c IP:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo fail2ban-client set sshd unbanip 123.123.123.123\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c fail2ban:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart fail2ban\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043b\u043e\u0433\u0438:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo journalctl -u fail2ban\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e&#8230;<\/h2>\n\n\n\n<p>\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f <strong>fail2ban<\/strong> \u0441 <strong>Telegram<\/strong> \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e, \u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e. \u0422\u044b \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u0443\u0437\u043d\u0430\u0435\u0448\u044c \u043e \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u0445 \u0432\u0437\u043b\u043e\u043c\u0430 \u0438 \u043c\u043e\u0436\u0435\u0448\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0445\u043e\u0441\u0442\u0438\u0442\u0441\u044f \u0432\u0430\u0436\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n\n\n\n<p>\u042d\u0442\u0430 \u0441\u0432\u044f\u0437\u043a\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u0430 \u043d\u0430 <strong>VPS<\/strong>, \u0433\u0434\u0435 \u043d\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u043f\u0430\u043d\u0435\u043b\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u2014 \u0442\u044b \u0441\u0430\u043c \u0441\u0435\u0431\u0435 \u0438 \u0430\u0434\u043c\u0438\u043d, \u0438 \u043e\u0445\u0440\u0430\u043d\u043d\u0438\u043a, \u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u043e\u0438\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c fail2ban \u0441 Telegram alert-\u0430\u043c\u0438 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u0441\u043f\u0430\u0442\u044c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u0435\u0435.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u043e\u0433\u0434\u0430 \u0442\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0448\u044c \u0441 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c VPS, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u043e\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 SSH-\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u0430\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0430\u0447\u0435\u043a\u0443. \u0411\u0440\u0443\u0442\u0444\u043e\u0440\u0441, \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u043f\u0430\u0440\u043e\u043b\u0435\u0439, \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u2014 \u0432\u0441\u0451 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0430\u0449\u0435, \u0447\u0435\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b. \u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0430\u0442\u0430\u043a \u2014 \u044d\u0442\u043e fail2ban. \u0410 \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0448\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0430\u043b\u0435\u0440\u0442\u044b \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 Telegram, \u043c\u043e\u0436\u043d\u043e [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":4370,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-4369","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bezopasnost"],"_links":{"self":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts\/4369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/comments?post=4369"}],"version-history":[{"count":2,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts\/4369\/revisions"}],"predecessor-version":[{"id":4372,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts\/4369\/revisions\/4372"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/media\/4370"}],"wp:attachment":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/media?parent=4369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/categories?post=4369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/tags?post=4369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}