2019-06-26

SSH lockout 60min after 5 brute force attempts in 10min

  1. install fail2ban
    $ sudo apt update
    $ sudo apt install fail2ban
    
  2. edit configuration
    $ sudo vi /etc/fail2ban/jail.conf
    
    [sshd]
    enabled  = true
    port     = ssh
    maxretry = 5    # 5 attempts not permitted
    findtime = 600  # within 10 minutes
    bantime  = 3600 # ban 1 hour
    logpath  = %(sshd_log)s
    backend  = %(sshd_backend)s
    
  3. unban an ip address
    $ sudo fail2ban-client set sshd unbanip IP_ADDRESS
    

No comments:

Post a Comment