fail2ban error sshd log file

5 months ago 69

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    = sshlogpath = /var/log/auth.logbackend = %(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


View Entire Post

Read Entire Article