fail2ban.php

Code Hygiene Score: 100

Keine Issues gefunden.

Code

<section>
<h2>5. Fail2Ban</h2>

<h3>5.1 Installation</h3>
<pre><code>apt-get install -y fail2ban</code></pre>

<h3>5.2 Konfiguration</h3>
<p>Datei: <code>/etc/fail2ban/jail.local</code></p>
<pre><code>[DEFAULT]
bantime = 1h
findtime = 10m
maxretry = 3
ignoreip = 127.0.0.1/8

[sshd]
enabled = true
port = 2022
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
bantime = 1h</code></pre>

<h3>5.3 Service starten</h3>
<pre><code>systemctl enable fail2ban
systemctl restart fail2ban</code></pre>

<h3>5.4 Gebannte IPs anzeigen</h3>
<pre><code>fail2ban-client status sshd</code></pre>
</section>
← Übersicht