> For the complete documentation index, see [llms.txt](https://kawsing.gitbook.io/opensystem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kawsing.gitbook.io/opensystem/andoid-shou-ji/untitled-4/fail2ban.md).

# Fail2ban

sudo apt install fail2ban

使用docker

{% embed url="<https://github.com/crazy-max/docker-fail2ban>" %}

## Fail2ban  的主要有以下三個設定檔&#x20;

&#x20;jail.(conf|local) ：用來設定 ,定義與 action 的對應關係。

filter.d/ 用來定義過濾條件 (filter) ,目錄下已定義多種既有的過濾條件,常見的軟體有 apache、nginx 、 sshd 、 vsftpd  等,記錄檔格式也可能為 Syslog 、 Common Log Format 等。&#x20;

action.d/ 用來定義動作 (action) ,目錄下已定義多種既有的動作,像是sendmail 『寄信通知』、 iptables 阻擋來源位址、使用 whois 查詢來源 domain 或 自動通知該來源 IP 的管理者。&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://kawsing.gitbook.io/opensystem/andoid-shou-ji/untitled-4/fail2ban.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
