fail2ban error sshd log file

fail2ban error sshd log file

ERROR Failed during configuration: Have not found any log file for sshd jail

Se ao configurar o fail2ban você recebe a mensagem: “ERROR Failed during configuration: Have not found any log file for sshd jail” , saiba como resolver seguindo o passo a passo abaixo.

Cheque se o arquivo auth.log existe em seu sistema utilizando o comando abaixo:

[ls -l /var/log/auth.log]

Se não existir, tente instalar o rsyslog e confira se ele aparecerá no sistema:

[sudo apt install rsyslog]

Em seguida, edite seu arquivo jail.local localizado em /etc/fail2ban .

Dentro do arquivo em [sshd] defina a seguinte configuração:

[port    = ssh

logpath = /var/log/auth.log

backend = %(sshd_backend)s]

Em seguida reinicie os serviços sshd e fail2ban: 

[sudo systemctl restart sshd]
[sudo systemctl restart fail2ban]

Com outro IP, tente se conectar com usuário errado. Para ver o banimento em funcionamento use o comando abaixo:

[sudo fail2ban-client status sshd]

A saída do comando acima será algo como:

Status for the jail: sshd

|- Filter

|  |- Currently failed: 0

|  |- Total failed:     5

|  `- File list:        /var/log/auth.log

`- Actions

   |- Currently banned: 1

   |- Total banned:     1

   `- Banned IP list:   xxx.xx.xxx.xxx

0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like