-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
+++ | ||
title = "fail2ban" | ||
date = 2025-01-15T18:40:00+08:00 | ||
lastmod = 2025-01-15T18:46:51+08:00 | ||
tags = ["linux", "network"] | ||
categories = ["技术"] | ||
draft = false | ||
+++ | ||
|
||
近日发现很多对于端口的扫描,虽然由于 ufw 的拦截并不能进入,但还是想用 fail2ban 来封禁这些 IP,减少被扫描的次数。因此增加了更多的 jail 配置。 <br/> | ||
|
||
<!--more--> | ||
|
||
|
||
## 设置 {#设置} | ||
|
||
编辑 `/etc/fail2ban/jail.d/defaults-debian.conf` 文件: <br/> | ||
|
||
```text | ||
[DEFAULT] | ||
banaction = ufw | ||
bantime = 10m | ||
banTime.increment = true | ||
[sshd] | ||
enabled = true | ||
[ufw] | ||
enabled = true | ||
filte = ufw | ||
action = iptables-allports | ||
logpath = /var/log/ufw.log | ||
maxretry = 1 | ||
``` | ||
|