Setting up limited password retries

Setting up limited password tries is a good way to prevent your SSH server from brute force attacks., in addition to fail2ban which does this automatically for SSH.

  1. Open the SSH configuration file.

sudo nano /etc/ssh/sshd_config
  1. Set the value of the MaxAuthTries option.

MaxAuthTries 3

The SSH server will allow only 3 login attempts per connection.

Last updated