ubuntu:fail2ban:install_fail2ban
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
ubuntu:fail2ban:install_fail2ban [2025/05/30 20:43] – [Configure fail2ban] peter | ubuntu: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 / | ||
+ | [DEFAULT] | ||
+ | ignoreip = 127.0.0.1/8 ::1 | ||
+ | bantime | ||
+ | findtime | ||
+ | maxretry = 5 | ||
+ | destemail = root@localhost | ||
+ | sender = root@mediaserver | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | To have these new settings, restart Fail2Ban: <code bash> | ||
+ | sudo systemctl restart fail2ban | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== 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 | ||
+ | </ | ||
</ | </ | ||
---- | ---- | ||
- | |||
- | Save and close the file. | ||
- | |||
- | ---- | ||
- | |||
===== Restart fail2ban ===== | ===== Restart fail2ban ===== |
ubuntu/fail2ban/install_fail2ban.txt · Last modified: 2025/05/30 20:54 by peter