fruworg.github.io/content/posts/ssh-fail2ban.md
root c793b55750 Revert "remove shell"
This reverts commit 65914f8895.
2023-09-24 18:58:33 +03:00

30 lines
530 B
Markdown

---
title: fail2ban для SSH
description: Защита от брута пароля к SSH
date: 2022-11-29T13:41:00+05:00
tags: [linux, ssh]
---
## Установка пакета fail2ban
```shell
apt -y install fail2ban
```
## Правило для ssh
``` shell
[sshd]
enabled = true
port = <ssh-port>
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
findtime = 300
bantime = 3600
# /etc/fail2ban/jail.d/sshd.conf
```
## Перезапуск сервиса fail2ban
```shell
systemctl restart fail2ban
```