Aller au contenu

Fail2ban

Unban ip

  1. Se connecter au mode interactif.

    fail2ban-client -i
    Fail2Ban v0.10.2 reads log file that contains password failure report
    and bans the corresponding IP addresses using firewall rules.
    fail2ban>
    
  2. Lister les IP bannis.

    fail2ban> status sshd
    Status for the jail: sshd
    |- Filter
    |  |- Currently failed: 0
    |  |- Total failed:     324641
    |  `- File list:        /var/log/auth.log
    `- Actions
    |- Currently banned: 5
    |- Total banned:     84426
    `- Banned IP list:   xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy
    
  3. Unban l'ip voulu.

    fail2ban> set sshd unbanip xxx.xxx.xxx.xxx
    xxx.xxx.xxx.xxx
    
  4. Vérifier que l'ip n'est plus présente.

    fail2ban> status sshd
    Status for the jail: sshd
    |- Filter
    |  |- Currently failed: 0
    |  |- Total failed:     324641
    |  `- File list:        /var/log/auth.log
    `- Actions
    |- Currently banned: 3
    |- Total banned:     84426
    `- Banned IP list:   yyy.yyy.yyy.yyy
    fail2ban>