User Tools

Site Tools


ubuntu:fail2ban:install_fail2ban

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntu:fail2ban:install_fail2ban [2022/06/30 20:34] 45.89.242.239ubuntu:fail2ban:install_fail2ban [2025/05/30 20:54] (current) peter
Line 38: Line 38:
   * **action.d** – contains various fail2ban actions configurations for things like mail and firewall.   * **action.d** – contains various fail2ban actions configurations for things like mail and firewall.
   * **jail.d** – contains additional fail2ban jail configurations.   * **jail.d** – contains additional fail2ban jail configurations.
 +
 +<WRAP important>
 +**WARNING:** The default values in **/etc/fail2ban/jail.conf** ​​may change with package updates, so it is recommended to create a **jail.local** file with the configuration changes needed.
 +</WRAP>
 +
 +----
 +
 +===== To modify some default settings =====
 +
 +Create the **jail.local** file if it does not exist, otherwise edit it and populate it with:
 +
 +<file bash /etc/fail2ban/jail.local>
 +[DEFAULT]
 +ignoreip = 127.0.0.1/8 ::1
 +bantime  = 1d
 +findtime  = 5m
 +maxretry = 5
 +destemail = root@localhost
 +sender = root@mediaserver
 +</file>
 +
 +<WRAP info>
 +**NOTE:**  Notice the **[DEFAULT]** tag.
 +
 +To have these new settings, restart Fail2Ban: <code bash>
 +sudo systemctl restart fail2ban
 +</code>
 +
 +</WRAP>
  
 ---- ----
  
-===== Create jail.local to prevent malicious SSH logins =====+===== To prevent malicious SSH logins =====
  
-Create the new **jail.local** file with:+Create the **jail.local** file if it does not exist, otherwise edit it and populate it with:
  
 <code bash> <code bash>
Line 75: Line 104:
   * **ignoreip** – An IP address that is to be ignored by fail2ban.   * **ignoreip** – An IP address that is to be ignored by fail2ban.
  
 +To have these new settings, restart Fail2Ban: <code bash>
 +sudo systemctl restart fail2ban
 +</code>
  
 </WRAP> </WRAP>
  
 ---- ----
- 
-Save and close the file. 
- 
----- 
- 
  
 ===== Restart fail2ban ===== ===== Restart fail2ban =====
ubuntu/fail2ban/install_fail2ban.1656621259.txt.gz · Last modified: 2022/06/30 20:34 by 45.89.242.239

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki