---
title: "端口防扫描"
description: "宝塔面板基于 fail2ban 实现端口防扫描，自动识别并封禁恶意 IP 对服务器的高频端口探测，预防端口渗透与暴力破解攻击。"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.bt.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 端口防扫描

本文将介绍如何开启端口防扫描。

端口防扫描基于fail2ban的能力实现，通过配置fail2ban的jail，实现端口防扫描。

## 操作步骤

1. 进入面板，点击左侧菜单栏的**安全设置** > **端口防扫描**，进入端口防扫描页面。
   
   ![导航栏-安全](/img/user-guide/security/menu-security.png)

   ![端口防扫描](/img/user-guide/security/port-anti-scan.png)

   若未安装fail2ban，将会提示安装，点击**立即安装**，安装fail2ban。

   ![安装fail2ban](/img/user-guide/security/install-fail2ban.png)

   等待安装完成后，继续完成端口防扫描的配置。

2. 通常情况下，在安装fail2ban后，会自动开启端口防扫描规则，无需手动开启。
   
   若未开启，点击**开启**，开启端口防扫描规则。

   ![开启端口防扫描规则](/img/user-guide/security/open-port-anti-scan.png)
   
   等待开启完成后，即可生效。

Source: https://docs.bt.cn/user-guide/security/firewall/port-anti-scan/index.mdx
