<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://wiki.cless.pro/index.php?action=history&amp;feed=atom&amp;title=Fail2ban._Centos_7._Installation_and_configuring</id>
	<title>Fail2ban. Centos 7. Installation and configuring - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.cless.pro/index.php?action=history&amp;feed=atom&amp;title=Fail2ban._Centos_7._Installation_and_configuring"/>
	<link rel="alternate" type="text/html" href="https://wiki.cless.pro/index.php?title=Fail2ban._Centos_7._Installation_and_configuring&amp;action=history"/>
	<updated>2026-10-22T22:45:06Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.36.2</generator>
	<entry>
		<id>https://wiki.cless.pro/index.php?title=Fail2ban._Centos_7._Installation_and_configuring&amp;diff=1384&amp;oldid=prev</id>
		<title>Cless: Новая страница: «= Links = https://losst.ru/nastrojka-fail2ban-centos-7  = Installation and configuring = &lt;code&gt;yum install epel-release&lt;/code&gt;  &lt;code&gt;yum install fail2ban&lt;/code&gt;...»</title>
		<link rel="alternate" type="text/html" href="https://wiki.cless.pro/index.php?title=Fail2ban._Centos_7._Installation_and_configuring&amp;diff=1384&amp;oldid=prev"/>
		<updated>2023-03-25T06:14:03Z</updated>

		<summary type="html">&lt;p&gt;Новая страница: «= Links = https://losst.ru/nastrojka-fail2ban-centos-7  = Installation and configuring = &amp;lt;code&amp;gt;yum install epel-release&amp;lt;/code&amp;gt;  &amp;lt;code&amp;gt;yum install fail2ban&amp;lt;/code&amp;gt;...»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Links =&lt;br /&gt;
https://losst.ru/nastrojka-fail2ban-centos-7&lt;br /&gt;
&lt;br /&gt;
= Installation and configuring =&lt;br /&gt;
&amp;lt;code&amp;gt;yum install epel-release&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;yum install fail2ban&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Backup original config '''/etc/fail2ban/jail.conf'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mv /etc/fail2ban/jail.conf /etc/fail2ban/jail.conf.ORIG&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will be rewrited on update, so don't use it&lt;br /&gt;
&lt;br /&gt;
Use /etc/fail2ban/jail.local config instead&lt;br /&gt;
&lt;br /&gt;
Copy orig conf to custom conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nano /etc/fail2ban/jail.local&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 # enable fail2ban&lt;br /&gt;
 enabled = true&lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;maxretry&amp;quot; is the number of failures before a host get banned.&lt;br /&gt;
 maxretry = 5&lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 # time to ban IP&lt;br /&gt;
 bantime  = 10m&lt;br /&gt;
 &lt;br /&gt;
 # A host is banned if it has generated &amp;quot;maxretry&amp;quot; during the last &amp;quot;findtime&amp;quot;&lt;br /&gt;
 findtime  = 10m&lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 # DELETE ALL SERVICES, EXCEPT SERVICES WE WILL USE&lt;br /&gt;
 # as example - SSHD&lt;br /&gt;
 &lt;br /&gt;
 [sshd]&lt;br /&gt;
 # To use more aggressive sshd modes set filter parameter &amp;quot;mode&amp;quot; in jail.local:&lt;br /&gt;
 # normal (default), ddos, extra or aggressive (combines all).&lt;br /&gt;
 # See &amp;quot;tests/files/logs/sshd&amp;quot; or &amp;quot;filter.d/sshd.conf&amp;quot; for usage example and details.&lt;br /&gt;
 #mode   = normal&lt;br /&gt;
 port    = ssh&lt;br /&gt;
 logpath = %(sshd_log)s&lt;br /&gt;
 backend = %(sshd_backend)s&lt;br /&gt;
 ...&lt;br /&gt;
Restart fail2ban&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl restart fail2ban&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Test from client =&lt;br /&gt;
Try to login to server 5 times with wrong password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh root@&amp;lt;server-with-fail2ban&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Test at server =&lt;br /&gt;
&amp;lt;code&amp;gt;cat /var/log/fail2ban.log&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 2021-03-08 11:51:28,721 fail2ban.filter         [2280]: INFO    [sshd] Found 192.168.17.250 - 2021-03-08 11:51:28&lt;br /&gt;
 2021-03-08 11:51:31,446 fail2ban.filter         [2280]: INFO    [sshd] Found 192.168.17.250 - 2021-03-08 11:51:31&lt;br /&gt;
 2021-03-08 11:51:33,862 fail2ban.filter         [2280]: INFO    [sshd] Found 192.168.17.250 - 2021-03-08 11:51:33&lt;br /&gt;
 2021-03-08 11:52:38,031 fail2ban.filter         [2280]: INFO    [sshd] Found 192.168.17.250 - 2021-03-08 11:52:38&lt;br /&gt;
 2021-03-08 11:52:40,501 fail2ban.filter         [2280]: INFO    [sshd] Found 192.168.17.250 - 2021-03-08 11:52:40&lt;br /&gt;
 2021-03-08 11:52:40,880 fail2ban.actions        [2280]: NOTICE  [sshd] Ban 192.168.17.250&lt;br /&gt;
 ...&lt;br /&gt;
Look at iptables rule&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;iptables -L f2b-sshd -v --line-numbers&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 Chain f2b-sshd (1 references)&lt;br /&gt;
 num   pkts bytes target     prot opt in     out     source               destination&lt;br /&gt;
 1        8  1004 REJECT     all  --  any    any     192.168.17.250       anywhere             reject-with icmp-port-unreachable&lt;br /&gt;
 ...&lt;br /&gt;
Client 192.168.17.250 is BANNED!&lt;br /&gt;
&lt;br /&gt;
Manual delete ban rule&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;iptables -D f2b-sshd 1&amp;lt;/code&amp;gt;&lt;br /&gt;
[[Категория:Fail2ban]]&lt;br /&gt;
__ОБЯЗАТЕЛЬНОЕ_ОГЛАВЛЕНИЕ__&lt;/div&gt;</summary>
		<author><name>Cless</name></author>
	</entry>
</feed>