{"id":2754,"date":"2018-06-06T09:08:37","date_gmt":"2018-06-06T09:08:37","guid":{"rendered":"https:\/\/tst-amo.net.ua\/blog\/?p=2754"},"modified":"2021-08-27T10:46:52","modified_gmt":"2021-08-27T10:46:52","slug":"fail2ban-2","status":"publish","type":"post","link":"https:\/\/tst-amo.net.ua\/blog\/?p=2754","title":{"rendered":"fail2ban"},"content":{"rendered":"<p><strong>CentOS 7 \/ Red Hat:<\/strong><\/p>\n<div class=\"console\">\n<pre>yum install fail2ban<\/pre>\n<\/div>\n<p><strong>Ubuntu \/ Debian:<\/strong><\/p>\n<div class=\"console\">\n<pre>apt install\u00a0fail2ban<\/pre>\n<\/div>\n<p><strong>CentOS 6:<\/strong><\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439:<\/p>\n<div class=\"console\">\n<pre>rpm -Uvh http:\/\/dl.fedoraproject.org\/pub\/epel\/6\/x86_64\/epel-release-6-8.noarch.rpm<\/pre>\n<\/div>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442:<\/p>\n<div class=\"console\">\n<pre>yum install fail2ban<\/pre>\n<\/div>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043b\u0443\u0436\u0431\u044b \u0432\u0432\u043e\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<div class=\"console\">\n<pre>systemctl enable fail2ban\r\n<span style=\"font-family: Consolas, Monaco, monospace;\">systemctl start fail2ban<\/span><\/pre>\n<\/div>\n<p><em>* \u0414\u043b\u044f \u0441\u0442\u0430\u0440\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0431\u0435\u0437 systemd \u044d\u0442\u043e \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b\u00a0<\/em><\/p>\n<pre>chkconfig fail2ban on\u00a0\r\nupdate-rc.d fail2ban defaults\u00a0\r\nservice\u00a0fail2ban start.<\/pre>\n<h3>\u0411\u0430\u0437\u043e\u0432\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h3>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u00a0fail2ban \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430 Linux. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e \u043f\u0443\u0442\u0438\u00a0<strong>\/etc\/fail2ban\/jail.conf<\/strong>. \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0433\u043e \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u043d\u044f\u0442\u044c \u0438 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438\u0437 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u00a0<strong>\/etc\/fail2ban\/jail.d<\/strong>.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0444\u0430\u0439\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<div class=\"console\">\n<pre>nano \/etc\/fail2ban\/jail.d\/default.conf<\/pre>\n<\/div>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u0435\u0433\u043e \u043a \u0432\u0438\u0434\u0443:<\/p>\n<div class=\"editor\">\n<pre>[DEFAULT]\r\nmaxretry = 4\r\nfindtime = 480\r\nbantime = 720\r\naction =\u00a0firewallcmd-ipset\r\nignoreip = 127.0.0.1\/8<\/pre>\n<\/div>\n<p><em>* \u0433\u0434\u0435:<\/em><\/p>\n<ul>\n<li><em><strong>maxretry\u00a0\u2014<\/strong>\u00a0\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0434\u043e \u0431\u0430\u043d\u0430.<\/em><\/li>\n<li><em><strong>findtime\u00a0\u2014<\/strong>\u00a0\u0432\u0440\u0435\u043c\u044f \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445, \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f maxretry;<\/em><\/li>\n<li><em><strong>bantime\u00a0\u2014<\/strong>\u00a0\u0432\u0440\u0435\u043c\u044f, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f IP-\u0430\u0434\u0440\u0435\u0441;<\/em><\/li>\n<li><em><strong>action<\/strong>\u00a0\u2014 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435\u00a0\u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 Fail2ban \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c \u043f\u043e\u0438\u0441\u043a\u0430;<\/em><\/li>\n<li><em><strong>ignoreip \u2014\u00a0<\/strong>\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0449\u0438\u0442\u0443, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0441 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432.<\/em><\/li>\n<\/ul>\n<p><em>* \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0435\u0441\u043b\u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 8 \u043c\u0438\u043d\u0443\u0442 (<strong>480<\/strong>)\u00a0\u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0434\u0435\u043d\u043e 5 \u0441\u0442\u0440\u043e\u043a (<strong>maxretry = 4<\/strong>), \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445\u00a0\u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430, Fail2ban \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 IP-\u0430\u0434\u0440\u0435\u0441, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 12 \u043c\u0438\u043d\u0443\u0442 (<strong>720<\/strong>);<br \/>\n* \u0412 \u0441\u0435\u043a\u0446\u0438\u0438 [DEFAULT] \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043e\u0431\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0440\u0430\u0432\u0438\u043b. \u041a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0440\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430.<\/em><\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b<\/h4>\n<p>\u0414\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u00a0\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435\u00a0<strong>\/etc\/fail2ban\/jail.d<\/strong>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<div class=\"console\">\n<pre>nano \/etc\/fail2ban\/jail.d\/service.conf<\/pre>\n<\/div>\n<div class=\"editor\">\n<pre>[ssh]\r\nenabled = true\r\nport = ssh\r\nfilter = sshd\r\naction = iptables[name=sshd, port=ssh, protocol=tcp]\r\nlogpath = \/var\/log\/auth.log\r\nmaxretry = 10\r\nfindtime = 600<\/pre>\n<\/div>\n<p><em>* \u0433\u0434\u0435:<\/em><\/p>\n<ul>\n<li><em><strong>ssh \u2014<\/strong>\u00a0\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430;<\/em><\/li>\n<li><em><strong>enabled<\/strong>\u00a0\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c (true) \u0438\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c (false) \u043f\u0440\u0430\u0432\u0438\u043b\u043e;<\/em><\/li>\n<li><em><strong>port \u2014<\/strong>\u00a0\u043f\u043e\u0440\u0442 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0431\u0443\u043a\u0432\u0435\u043d\u043d\u043e\u0435 \u0438\u043b\u0438 \u0446\u0438\u0444\u0438\u0440\u043d\u043e\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435;<\/em><\/li>\n<li><em><strong>filter \u2014<\/strong>\u00a0\u0444\u0438\u043b\u044c\u0442\u0440 (\u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u043f\u043e\u0438\u0441\u043a\u0430), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0438\u0437 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u00a0<strong>\/etc\/fail2ban\/filter.d<\/strong>\u0431\u0435\u0437 .conf \u043d\u0430 \u043a\u043e\u043d\u0446\u0435;<\/em><\/li>\n<li><em><strong>action \u2014<\/strong>\u00a0\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u043c\u043e\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430. \u0412 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043f\u043e\u0440\u0442 \u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f;<\/em><\/li>\n<li><em><strong>logpath \u2014<\/strong>\u00a0\u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043b\u043e\u0433-\u0444\u0430\u0439\u043b\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0444\u0438\u043b\u044c\u0442\u0440 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432.<\/em><\/li>\n<\/ul>\n<p><em>* \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u044b \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\u00a0<strong>maxretry<\/strong>,\u00a0<\/em><strong>findtime<\/strong><em>\u00a0\u0438\u00a0<strong>action<\/strong>.<\/em><\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0442\u0443\u043f\u0438\u043b\u0438 \u0432 \u0441\u0438\u043b\u0443, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441:<\/p>\n<div class=\"console\">\n<pre>systemctl restart fail2ban<\/pre>\n<\/div>\n<p><em>* \u0432 \u0441\u0442\u0430\u0440\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445\u00a0<\/em><\/p>\n<pre>service\u00a0fail2ban restart.<\/pre>\n<h3>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u044b<\/h3>\n<p>\u0424\u0430\u0439\u043b\u044b \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435\u00a0<strong>\/etc\/fail2ban\/action.d<\/strong>. \u0427\u0442\u043e\u0431\u044b \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441,\u00a0Fail2ban \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432 \u0431\u0440\u0430\u043d\u0434\u043c\u0430\u0443\u044d\u0440\u0435 netfilter. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u044b\u00a0iptables \u0438\u043b\u0438 firewall-cmd. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f\u00a0\u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 CentOS \/ Red Hat \/ Fedora.\u00a0iptables \u0431\u043e\u043b\u0435\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u0438 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0447\u0442\u0438, \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 Linux.<\/p>\n<p>\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u0430\u043c\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439:<\/p>\n<ul>\n<li>iptables \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 netfilter \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b;<\/li>\n<li>iptables-multiport \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f\u00a0multiports, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u043f\u043e\u0440\u0442\u043e\u0432 \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438;<\/li>\n<li>iptables-ipset \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u00a0<a href=\"https:\/\/www.dmosk.ru\/terminus.php?object=ipset\">ipset<\/a>\u00a0\u0434\u043b\u044f \u043f\u0440\u0438\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u0432\u0438\u0434\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c;<\/li>\n<li>iptables-allports \u2014 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0434\u043b\u044f \u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u0441\u0435 \u043f\u043e\u0440\u0442\u044b;<\/li>\n<li>firewallcmd-new \u2014\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 netfilter \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e firewall-cmd;<\/li>\n<li>firewallcmd-ipset \u2014 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b firewall-cmd, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f ipset;<\/li>\n<li>firewallcmd-rich-rules \u2014 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u00a0rich-rules \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 firewall-cmd.<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 netfilter \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438\u00a0<a href=\"https:\/\/www.dmosk.ru\/instruktions.php?object=iptables-settings\">iptables<\/a>\u00a0\u0438\u00a0<a href=\"https:\/\/www.dmosk.ru\/miniinstruktions.php?mini=firewalld-centos\">firewalld<\/a>.<\/p>\n<p>\u0424\u0438\u043b\u044c\u0442\u0440\u044b, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 \u0432 log-\u0444\u0430\u0439\u043b\u0430\u0445. \u041e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435\u00a0<strong>\/etc\/fail2ban\/filter.d<\/strong>.<\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0432\u043e\u0438\u0445 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u044e\u0449\u0438\u0435\u0441\u044f \u0444\u0430\u0439\u043b\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0438.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u0430\u0432\u0438\u043b<\/h3>\n<p>\u0412 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u00a0IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0430 12 \u043c\u0438\u043d\u0443\u0442 \u043f\u043e\u0441\u043b\u0435 4-\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 8 \u043c\u0438\u043d\u0443\u0442. \u042d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b\u00a0\u0431\u0435\u0440\u0443\u0442\u0441\u044f\u00a0\u0438\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a [DEFAULT]. \u0415\u0441\u043b\u0438 \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0445 \u043f\u0440\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430.<\/p>\n<h3>SSH<\/h3>\n<h4>CentOS<\/h4>\n<div class=\"console\">\n<pre>vi\u00a0\/etc\/fail2ban\/jail.d\/ssh.conf<\/pre>\n<\/div>\n<div class=\"editor\">\n<pre>[ssh]\r\nenabled = true\r\nport = ssh\r\nfilter = sshd\r\naction = firewallcmd-new[name=sshd]\r\nlogpath = \/var\/log\/secure<\/pre>\n<\/div>\n<h4>Ubuntu<\/h4>\n<div class=\"console\">\n<pre>vi\u00a0\/etc\/fail2ban\/jail.d\/ssh.conf<\/pre>\n<\/div>\n<div class=\"editor\">\n<pre>[ssh]\r\nenabled = true\r\nport = ssh\r\nfilter = sshd\r\naction = iptables[name=sshd]\r\nlogpath = \/var\/log\/auth.log<\/pre>\n<\/div>\n<h3>Asterisk<\/h3>\n<div class=\"console\">\n<pre>vi\u00a0\/etc\/fail2ban\/jail.d\/asterisk.conf<\/pre>\n<\/div>\n<div class=\"editor\">\n<pre>[asterisk]\r\nenabled = true\r\nfilter = asterisk\r\naction =\u00a0iptables-allports[name=asterisk, protocol=all]\r\nlogpath = \/var\/log\/asterisk\/messages<\/pre>\n<\/div>\n<h3>NGINX<\/h3>\n<div class=\"console\">\n<pre>vi\u00a0\/etc\/fail2ban\/jail.d\/nginx.conf<\/pre>\n<\/div>\n<div class=\"editor\">\n<pre>[nginx]\r\nenabled = true\r\nport =\u00a0http,https\r\nfilter =\u00a0nginx-http-auth\r\naction =\u00a0iptables-multiport[name=nginx, port=\"http,https\", protocol=tcp]\r\nlogpath = \/var\/log\/nginx\/error.log<\/pre>\n<\/div>\n<h3>NGINX DDoS (req limit)<\/h3>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 nginx \u043e\u0442 DDoS-\u0430\u0442\u0430\u043a. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0431\u043e\u0440\u043a\u0430\u0445, \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043c\u044b \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440:<\/p>\n<div class=\"console\">\n<pre>vi\u00a0\/etc\/fail2ban\/filter.d\/nginx-limit-req.conf<\/pre>\n<\/div>\n<div class=\"editor\">\n<pre>[Definition]\r\n\r\nngx_limit_req_zones = [^\"]+\r\nfailregex = ^\\s*\\[error\\] \\d+#\\d+: \\*\\d+ limiting requests, excess: [\\d\\.]+ by zone \"(?:%(ngx_limit_req_zones)s)\", client: &lt;HOST&gt;\r\nignoreregex =<\/pre>\n<\/div>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432 Fail2ban:<\/p>\n<div class=\"console\">\n<pre>vi\u00a0\/etc\/fail2ban\/jail.d\/nginx-ddos.conf<\/pre>\n<\/div>\n<div class=\"editor\">\n<pre>[nginx-ddos]\r\nenabled = true\r\nport =\u00a0http,https\r\nfilter =\u00a0nginx-limit-req\r\naction =\u00a0iptables-multiport[name=nginxddos, port=\"http,https\", protocol=tcp]\r\nlogpath = \/var\/log\/nginx\/error.log<\/pre>\n<\/div>\n<h3>OWNCLOWD<\/h3>\n<pre>vi\u00a0\/etc\/fail2ban\/filter.d\/owncloud.conf\r\n\r\n[Definition]\r\nfailregex={.*Login failed: \\'.*\\' \\(Remote IP: \\'&lt;HOST&gt;\\'\\)\"}\r\nignoreregex =<\/pre>\n<pre>vi\u00a0\/etc\/fail2ban\/jail.d\/owncloud.conf\r\n\r\n[owncloud]\r\nenabled = true\r\nfilter = owncloud\r\nignoreip = 127.0.0.1\/8 192.168.1.47 194.44.219.161 194.44.219.163 194.44.219.164\r\n#action = smeserver-iptables[port=\"$port\",protocol=tcp,bantime=$bantime]\r\nlogpath = \/var\/www\/html\/owncloud\/data\/owncloud.log\r\nmaxretry = 3\r\nport = 80,443\r\nbantime = 10800\r\nprotocol = tcp<\/pre>\n<h3>WORDPRESS<\/h3>\n<pre>vi\u00a0\/etc\/fail2ban\/filter.d\/wp-login.conf\r\n\r\n[Definition]\r\nfailregex = ^&lt;HOST&gt; .* \"POST .*wp-login.php\r\n            ^&lt;HOST&gt; .* \"POST .*xmlrpc.php\r\nignoreregex =<\/pre>\n<pre>vi\u00a0\/etc\/fail2ban\/jail.d\/wp-login.conf\r\n\r\n[wp-login]\r\nenabled = true\r\nignoreip = 127.0.0.1\/8 192.168.0.0\/24\r\naction = iptables-multiport[name=WP, port=\"http,https\" protocol=tcp]\r\n# \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u043e\u0447\u0442\u0443, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\r\n# sendmail[name=wp-login, dest=zeroxzed@gmail.com, sender=fail2ban@serveradmin.ru]\r\nfilter = wp-login\r\nlogpath = \/var\/log\/nginx\/access.log\r\nbantime = 10800\r\nmaxretry = 3<\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:<\/p>\n<pre>fail2ban-regex \/var\/log\/nginx\/access.log \/etc\/fail2ban\/filter.d\/wp-login.conf<\/pre>\n<pre>Results\r\n=======\r\n\r\nFailregex: 4 total\r\n|- #) [# of hits] regular expression\r\n| 1) [<span style=\"color: #ff0000;\">3<\/span>] ^&lt;HOST&gt; .* \"POST .*wp-login.php\r\n| 2) [<span style=\"color: #ff0000;\">1<\/span>] ^&lt;HOST&gt; .* \"POST .*xmlrpc.php\r\n`-\r\nIgnoreregex: 0 total\r\n\r\nDate template hits:\r\n|- [# of hits] date format\r\n| [302] Day(?P&lt;_sep&gt;[-\/])MON(?P=_sep)Year[ :]?24hour:Minute:Second(?:\\.Microseconds)?(?: Zone offset)?\r\n`-\r\nLines: 302 lines, 0 ignored, <span style=\"color: #ff0000;\">4 matched<\/span>, 298 missed\r\n[processed in 0.06 sec]<\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c fail2ban:<\/p>\n<div class=\"console\">\n<pre>systemctl restart fail2ban<\/pre>\n<h3>SEAFILE<\/h3>\n<pre># vi \/etc\/fail2ban\/jail.d\/seafile.conf\r\n\r\n# All standard jails are in the file configuration located\r\n# \/etc\/fail2ban\/jail.conf\r\n\r\n# Warning you may override any other parameter (e.g. banaction,\r\n# action, port, logpath, etc) in that section within jail.local\r\n\r\n# Change logpath with your file log used by seafile (e.g. seahub.log)\r\n# Also you can change the max retry var (3 attemps = 1 line written in the\r\n# seafile log)\r\n# So with this maxrety to 1, the user can try 3 times before his IP is banned\r\n\r\n[seafile]\r\n\r\nenabled = true\r\nport = http,https\r\nfilter = seafile-auth\r\nlogpath = \/home\/www\/seafile\/logs\/seahub.log\r\nmaxretry = 3<\/pre>\n<pre># vi \/etc\/fail2ban\/filter.d\/seafile-auth.conf\r\n\r\n# Fail2Ban filter for seafile\r\n#\r\n\r\n[INCLUDES]\r\n\r\n# Read common prefixes. If any customizations available -- read them from\r\n# common.local\r\nbefore = common.conf\r\n\r\n[Definition]\r\n\r\n_daemon = seaf-server\r\n\r\nfailregex = Login attempt limit reached.*, ip: &lt;HOST&gt;\r\n\r\nignoreregex =\r\n\r\n# DEV Notes:\r\n#\r\n# pattern : 2015-10-20 15:20:32,402 [WARNING] seahub.auth.views:155 login Login attempt limit reached, username: &lt;user&gt;, ip: 1.2.3.4, attemps: 3\r\n# 2015-10-20 17:04:32,235 [WARNING] seahub.auth.views:163 login Login attempt limit reached, ip: 1.2.3.4, attempts: 3<\/pre>\n<p>\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:<\/p>\n<pre># fail2ban-client reload\r\n# fail2ban-client status\r\n# fail2ban-regex \/home\/www\/seafile\/logs\/seahub.log \/etc\/fail2ban\/filter.d\/seafile-auth.conf<\/pre>\n<\/div>\n<h3>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432<\/h3>\n<h3>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440<\/h3>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443\u00a0\u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<div class=\"console\">\n<pre>fail2ban-client status &lt;\u0438\u043c\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430&gt;<\/pre>\n<\/div>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u0430\u0432\u0438\u043b \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<div class=\"console\">\n<pre>fail2ban-client status<\/pre>\n<\/div>\n<p>\u041f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<div class=\"console-like\">\n<pre>`- action\r\n\u00a0 \u00a0|- Currently banned: 2\r\n\u00a0 \u00a0| \u00a0`- IP list: \u00a0 \u00a0 \u00a0 31.207.47.55 10.212.245.29<\/pre>\n<\/div>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e iptables:<\/p>\n<div class=\"console\">\n<pre>iptables -L -n\u00a0--line<\/pre>\n<\/div>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e firewall-cmd:<\/p>\n<div class=\"console\">\n<pre>firewall-cmd --direct --get-all-rules<\/pre>\n<\/div>\n<h3>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p><strong>\u0421\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438\u00a0fail2ban:<\/strong><\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u0432\u0432\u043e\u0434\u0438\u043c:<\/p>\n<div class=\"console\">\n<pre>fail2ban-client set &lt;\u0438\u043c\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430&gt; unbanip &lt;IP-\u0430\u0434\u0440\u0435\u0441&gt;<\/pre>\n<\/div>\n<p>\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<div class=\"console\" data-markered=\"true\">\n<pre>fail2ban-client set ssh\u00a0unbanip\u00a031.207.47.55<\/pre>\n<\/div>\n<p><strong>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e iptables:<\/strong><\/p>\n<div class=\"console\">\n<pre>iptables -D &lt;\u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b&gt;\u00a0-s IP-\u0430\u0434\u0440\u0435\u0441<\/pre>\n<\/div>\n<p>\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<div class=\"console\">\n<pre>iptables -D fail2ban-ssh -s 10.212.245.29<\/pre>\n<\/div>\n<p><strong>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e firewall-cmd:<\/strong><\/p>\n<div class=\"console\">\n<pre>firewall-cmd --direct --permanent --remove-rule &lt;\u043f\u0440\u0430\u0432\u0438\u043b\u043e&gt;<\/pre>\n<\/div>\n<p>\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<div class=\"console\">\n<pre>firewall-cmd --direct --permanent --remove-rule ipv4 filter f2b-sshd 0 -s 188.134.7.221<\/pre>\n<\/div>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430:<\/p>\n<div class=\"console\">\n<pre>firewall-cmd --reload<\/pre>\n<p>https:\/\/www.dmosk.ru\/instruktions.php?object=fail2ban<\/p>\n<\/div>\n<div class=\"pdfprnt-buttons pdfprnt-buttons-post pdfprnt-bottom-right\"><a href=\"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=wpv2posts2754&print=pdf\" class=\"pdfprnt-button pdfprnt-button-pdf\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/tst-amo.net.ua\/blog\/wp-content\/plugins\/pdf-print\/images\/pdf.png\" alt=\"image_pdf\" title=\"View PDF\" \/><\/a><a href=\"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=wpv2posts2754&print=print\" class=\"pdfprnt-button pdfprnt-button-print\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/tst-amo.net.ua\/blog\/wp-content\/plugins\/pdf-print\/images\/print.png\" alt=\"image_print\" title=\"Print Content\" \/><\/a><\/div>","protected":false},"excerpt":{"rendered":"<p>CentOS 7 \/ Red Hat: yum install fail2ban Ubuntu \/ Debian: apt install\u00a0fail2ban CentOS 6: \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439: rpm -Uvh http:\/\/dl.fedoraproject.org\/pub\/epel\/6\/x86_64\/epel-release-6-8.noarch.rpm \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442: yum install fail2ban \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043b\u0443\u0436\u0431\u044b \u0432\u0432\u043e\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b: systemctl enable fail2ban systemctl start fail2ban * \u0414\u043b\u044f \u0441\u0442\u0430\u0440\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0431\u0435\u0437 systemd \u044d\u0442\u043e \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b\u00a0 chkconfig fail2ban on\u00a0 update-rc.d fail2ban defaults\u00a0 service\u00a0fail2ban start. \u0411\u0430\u0437\u043e\u0432\u0430\u044f &#8230;<\/p>\n<p><a href=\"https:\/\/tst-amo.net.ua\/blog\/?p=2754\" class=\"more-link\">Continue reading &lsquo;fail2ban&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[119,45,80,47],"tags":[],"class_list":["post-2754","post","type-post","status-publish","format-standard","hentry","category-fail2ban","category-firewall","category-iptables","category-linux"],"_links":{"self":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2754"}],"collection":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2754"}],"version-history":[{"count":6,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2754\/revisions"}],"predecessor-version":[{"id":4824,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2754\/revisions\/4824"}],"wp:attachment":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}