29 lines
355 B
Markdown
29 lines
355 B
Markdown
|
# Use Fail2ban
|
||
|
|
||
|
## Installation
|
||
|
|
||
|
```
|
||
|
apt install fail2ban
|
||
|
```
|
||
|
|
||
|
## Configuration
|
||
|
|
||
|
Add the following to `/etc/fail2ban/jail.d/defaults-debian.local`:
|
||
|
|
||
|
```
|
||
|
[DEFAULT]
|
||
|
# in seconds
|
||
|
bantime = 3600
|
||
|
maxretry = 3
|
||
|
backend = auto
|
||
|
|
||
|
[sshd]
|
||
|
enabled = true
|
||
|
filter = sshd
|
||
|
backend = systemd
|
||
|
```
|
||
|
|
||
|
## Apply Changes
|
||
|
|
||
|
Run `service fail2ban restart` to activate the changes.
|