Outils pour utilisateurs

Outils du site


gnu-linux:reseau:fail2ban

Ceci est une ancienne révision du document !


Fail2ban

Installation

Debian

En root :

apt install fail2ban

Utilisation

Statuts

Exemple pour ssh, taper: fail2ban-client status sshd

Bannir manuellement

Exemple pour ssh, taper: fail2ban-client set sshd banip 192.168.1.2

De-bannir manuellement

Exemple pour ssh, taper: fail2ban-client set sshd unbanip 192.168.1.2

Configurations

Configurations générale

La configuration générale se trouve dans la section[DEFAULT], modifiable en root dans /etc/fail2ban/jail.conf.

  • Liste blanche: noter une IP, une IP avec CIDR masks, ou un hosts, exemple : ignoreip = 127.0.0.1/8 192.168.1.0/8 42.50.26.154 toto.moi

Jail ssh

En root, d /etc/fail2ban/jail.conf, chercher la section [sshd], voir exemple de configuration ci-dessous.

[sshd]
enabled = true
port    = ssh
logpath = %(sshd_log)s
backend = %(sshd_backend)s
maxretry = 2
bantime  = 30m
findtime  = 2m

Jail samba

Références

gnu-linux/reseau/fail2ban.1600798144.txt.gz · Dernière modification : 2022/12/17 14:09 (modification externe)