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
ubuntu:fail2ban:install_fail2ban [2025/05/30 20:43] – [Configure fail2ban] peterubuntu:fail2ban:install_fail2ban [2025/05/30 20:54] (current) peter
Line 45: Line 45:
 ---- ----
  
-===== Create jail.local to prevent malicious SSH logins =====+===== To modify some default settings =====
  
-Create the new **jail.local** file with:+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> 
 + 
 +---- 
 + 
 +===== To prevent malicious SSH logins ===== 
 + 
 +Create the **jail.local** file if it does not exist, otherwise edit it and populate it with:
  
 <code bash> <code bash>
Line 79: 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.txt · Last modified: 2025/05/30 20:54 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki