Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
service [2023/07/31 15:15] – created nadir | service [2023/08/03 10:01] (current) – removed nadir | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Fail2Ban Documentation ====== | ||
- | |||
- | ==== Introduction ==== | ||
- | |||
- | Fail2Ban is an intrusion prevention software that helps protect your system from brute-force attacks and other malicious activities. It monitors log files and takes action against IP addresses that show suspicious behavior. This documentation provides an overview of Fail2Ban and how to set it up on your system. | ||
- | |||
- | ==== Installation ==== | ||
- | |||
- | To install Fail2Ban on your system, follow these steps: | ||
- | |||
- | == Step 1: Update Package List == | ||
- | Before installing Fail2Ban, update the package list to ensure you get the latest version available: | ||
- | <cli> | ||
- | $ sudo apt update | ||
- | </ | ||
- | |||
- | == Step 2: Install Fail2Ban == | ||
- | |||
- | Install Fail2Ban using your package manager (for Ubuntu/ | ||
- | <cli> | ||
- | $ sudo apt install fail2ban | ||
- | </ | ||
- | |||
- | ==== Configuration ==== | ||
- | |||
- | Fail2Ban' | ||
- | |||
- | == Step 1: Copy the Configuration File == | ||
- | |||
- | <cli> | ||
- | $ sudo cp / | ||
- | </ | ||
- | |||
- | == Step 2: Edit the Configuration == | ||
- | |||
- | Open / | ||
- | * bantime: The duration in seconds for which an IP address is banned. | ||
- | * maxretry: The number of failed login attempts before banning an IP . | ||
- | // | ||
- | By default the server allows 3 wrong password retries , to fail2ban it only counts as one | ||
- | |||
- | * destemail: The email address where notifications are sent. | ||
- | |||
- | == Step 3: Restart Fail2Ban == | ||
- | |||
- | After making changes to the configuration, | ||
- | <cli> | ||
- | $ sudo systemctl restart fail2ban | ||
- | </ | ||
- | ==== Monitoring and Troubleshooting ==== | ||
- | |||
- | Fail2Ban provides several commands to monitor and troubleshoot its functionality: | ||
- | |||
- | * fail2ban-client status: Check the status of Fail2Ban and the number of bans in effect. | ||
- | * fail2ban-client status < | ||
- | * fail2ban-client set < | ||
- | |||