Other Articles

Servers – Ensure SSH MaxAuthTries is Set to 4 or Less

Support > Fixing Checks > Server

06 March, 2026

This check ensures that SSH MaxAuthTries is configured to 4 or less.

The MaxAuthTries parameter defines the maximum number of authentication attempts allowed per SSH connection. Keeping this value low helps reduce the risk of brute-force attacks.

Check Details

  • Resource: Server
  • Check: Ensure SSH MaxAuthTries is set to 4 or less
  • Risk: Higher values increase the chances of successful brute-force attacks on SSH services.

Remediation Steps

  1. Open a terminal session on the server with root or sudo privileges.
  2. Check the current value of MaxAuthTries using the following command:

    sshd -T | grep maxauthtries
    
  3. Open the SSH configuration file for editing:

    sudo vi /etc/ssh/sshd_config
    
  4. Locate or add the following line and set the value to 4 or less:

    MaxAuthTries 4
    
  5. Save the file and exit the editor.
  6. Restart the SSH service to apply changes:

    sudo systemctl restart sshd
    
  7. Verify that the configuration has been applied successfully by re-running the audit command.
  8. Perform regular audits to ensure SSH configurations remain compliant with security policies.