<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fail2ban &#8211; Hostry Help Center</title>
	<atom:link href="https://help.hostry.com/article-tags/fail2ban/feed/" rel="self" type="application/rss+xml" />
	<link>https://help.hostry.com</link>
	<description>Full information on how to use HOSTRY, provided by 24/7 community based support</description>
	<lastBuildDate>Wed, 23 Feb 2022 11:08:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.12</generator>

<image>
	<url>https://help.hostry.com/wp-content/uploads/cache/2021/01/cropped-apple-icon-180x180-1/836712163.png</url>
	<title>Fail2ban &#8211; Hostry Help Center</title>
	<link>https://help.hostry.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Configure and Properly Set Up Fail2ban on Debian 11</title>
		<link>https://help.hostry.com/knowledge-base/how-to-configure-and-properly-set-up-fail2ban-on-debian-11/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-configure-and-properly-set-up-fail2ban-on-debian-11/#comments</comments>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Wed, 23 Feb 2022 11:08:08 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=4742</guid>

					<description><![CDATA[Fail2Ban is a great and very useful tool that scans log files (eg /var/log/apache/error_log ) and blocks IP addresses that show signs of malware &#8211; too many bad passwords, search for exploits and others. This article will focus on a Linux server running on Debian 11. Preliminary Actions First you [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><strong><a href="https://www.fail2ban.org/wiki/index.php/Main_Page">Fail2Ban</a></strong> is a great and very useful tool that scans log files (eg /var/log/apache/error_log ) and blocks IP addresses that show signs of malware &#8211; too many bad passwords, search for exploits and others. This article will focus on a Linux server running on Debian 11. </p>



<h2 id="preliminary-actions" >Preliminary Actions</h2>



<p>First you need to update your server. To do this, enter a simple command:</p>



<pre class="wp-block-code"><code>apt update &amp;&amp; upgrade</code></pre>



<p>It is worth noting that the installation is not difficult, since <strong>Fail2Ban</strong> is already included in the repositories of your Debian 11. Installation is easy, just enter the command:</p>



<pre class="wp-block-code"><code>apt install fail2ban</code></pre>



<p>After you set it up, please check. The verification step is extremely important for making future adjustments:</p>



<pre class="wp-block-code"><code>systemctl status fail2ban</code></pre>



<p>If <strong>Fail2ban</strong> is not running on your instance, you need to run it. This can be done with the following command:</p>



<pre class="wp-block-code"><code>systemctl start fail2ban</code></pre>



<p>Next, move on to configuring <strong>Fail2ban</strong>. This is necessary for proper launch. Enter the following command:</p>



<pre class="wp-block-code"><code>systemctl enable fail2ban</code></pre>



<h2 id="configuring-fail2ban" >Configuring Fail2Ban</h2>



<p>If the first installation step was successfully completed and verified, then you can proceed to the Fail2ban configuration. Fail2ban is installed bundled with a default configuration file. This file contains configurable settings in Fail2ban. The file location is as follows:</p>



<pre class="wp-block-code"><code>/etc/fail2ban/jail.conf</code></pre>



<p>The file contains settings known as filters for configuring Fail2ban. This tool also has many options in its configuration file. These options can be useful for specific scripts and services that work with each other on your Linux machine.</p>



<ul><li>The <strong>bantime</strong> value is the exact time during which the malicious IP is blocked</li><li>The <strong>maxretry</strong> value &#8211; The number of times the user will try to login. If the limit is exceeded, the IP address is blocked.</li><li>The <strong>ignoreip</strong> value is the networks you trust. All networks you enter here will bypass Fai2Ban filtering.</li><li>The<strong> enable</strong> value allows Fail2ban to confirm whether you want this jail to be enabled or disabled.</li></ul>



<p>Next is to talk about <strong>jails</strong>. It has an individual customization option. Jails can increase the security of your Linux computer in many ways. You can add different filters to your server services. The first step is to create the jail.local configuration file. You can do it like this:</p>



<pre class="wp-block-code"><code>touch /etc/fail2ban/jail.local</code></pre>



<p>Open <strong>jail.local</strong> in a text editor of your choice.</p>



<pre class="wp-block-code"><code>nano /etc/fail2ban/jail.local.</code></pre>



<p>After the clarifications above have been provided regarding hail conf. you will be able to apply this directly to the configuration.</p>



<pre class="wp-block-code"><code>enabled = true
port = ssh
bantime = 10h
maxretry = 12
ignoreip = Any_IP

&#91;apache-badbots]
enabled = true
port = http,https, smtp...
bantime = 72h
maxretry = 3

&#91;squid]
enabled = false
port = 80,443,25, 1234...</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-configure-and-properly-set-up-fail2ban-on-debian-11/feed/</wfw:commentRss>
			<slash:comments>457</slash:comments>
		
		
			</item>
		<item>
		<title>How To Install And Configure Fail2ban Under CentOS</title>
		<link>https://help.hostry.com/knowledge-base/how-to-install-and-configure-fail2ban-under-centos/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-install-and-configure-fail2ban-under-centos/#respond</comments>
		
		<dc:creator><![CDATA[Paul Harris]]></dc:creator>
		<pubDate>Tue, 20 Aug 2019 13:39:20 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=527</guid>

					<description><![CDATA[Fail2ban &#8211; a service that can greatly &#8220;cool the ardor&#8221; of bots continuously trying to find a password for your server. Install fail2ban packages from the epel repository If the epel package is not installed, enter the commands user @ localhost: ~ $ sudo yum -y install epel-release Afrer install [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Fail2ban &#8211; a service that can greatly &#8220;<strong>cool the ardor</strong>&#8221; of bots continuously trying to find a password for your server.</p>



<h2 id="install-fail2ban-packages-from-the-epel-repository" >Install fail2ban packages from the epel repository</h2>



<p>If the epel package is not installed, enter the commands</p>



<p><code>user @ localhost: ~ $ sudo yum -y install epel-release  </code></p>



<p>Afrer install fail2ban itself</p>



<p><code>user @ localhost: ~ $ sudo yum -y install fail2ban</code></p>



<h2 id="activate-sshd-protection-in-fai2ban-settings" >Activate sshd protection in fai2ban settings</h2>



<p>Open the file<strong> /etc/fail2ban/jail.conf</strong> for editing, in the first lines we find the lines</p>



<p><code># [sshd] # enabled = true</code></p>



<p>Then delete the first characters &#8216;#&#8217;, it should work</p>



<p><code>[sshd]</code></p>



<p><code>enabled = true</code></p>



<p>Restart the service</p>



<p><code>user@localhost:~$ sudo systemctl restart fail2ban</code></p>



<p>Check the <strong>general status</strong></p>



<p><code>user@localhost:~$ sudo fail2ban-client status</code></p>



<p>You should be see something like</p>



<p><code>Status<br> |- Number of jail:    1<br> `- Jail list:    sshd</code></p>



<p></p>



<p><code>user@localhost:~$ sudo fail2ban-client status sshd</code></p>



<p><code>Status for the jail: sshd<br> |- Filter<br> |  |- Currently failed:    0<br> |  |- Total failed:    15<br> |  - Journal matches:    _SYSTEMD_UNIT=sshd.service + _COMM=sshd - Actions<br>    |- Currently banned:    0<br>    |- Total banned:    0<br>    `- Banned IP list:</code></p>



<p></p>



<p>Do not check how the blocking works from the same IP from which you are already connected via SSH and configure fail2ban, you may lose connection for a long time). </p>



<p>We try to enter the wrong password 4 times to our host from any IP (for example, from <strong>11.12.13.14)</strong>. If everything works correctly for 5-6 times an unsuccessful login, the password will no longer be requested and the connection will be refused</p>



<p><code>user@localhost:~$  sudo fail2ban-client status sshd</code></p>



<p><code>Status for the jail: sshd<br> |- Filter<br> |  |- Currently failed:    0<br> |  |- Total failed:    20<br> |  - Journal matches:    _SYSTEMD_UNIT=sshd.service + _COMM=sshd - Actions<br>    |- Currently banned:    1<br>    |- Total banned:    1<br>    `- Banned IP list: 11.12.13.14</code></p>



<p>If you want to remove any IP address from the block list, you can enter the command</p>



<p><code>user@localhost:~$  sudo fail2ban-client set sshd unbanip &lt;IP&gt;</code></p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-install-and-configure-fail2ban-under-centos/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
