What should I do if the error "Too many authentication failures" is displayed?

Problem Phenomenon

When using a third-party SSH client to remotely connect to a Linux instance, the connection fails and the message "Too many authentication failures" is displayed.

Problem Causes

The password retry policy is configured in the SSH remote login configuration file (/etc/ssh/sshd_config) in the ECS instance. After entering wrong passwords for many times, this error will be displayed.

Note This configuration will not cause the relevant account to be locked, but will only disconnect the corresponding session. You can try to log in by entering your password again.


If you have entered your password multiple times and still cannot log in, it is recommended that you reset your password and log in again.

The password retry policy can improve the security of the ECS instance. It is recommended that you decide whether to modify the relevant configuration after weighing security and usability. If you need to modify the password retry policy, please refer to the following steps.

1. Log in to the ECS instance using VNC.

2. Execute the following command to check whether the sshd_config file contains configurations similar to the following.

cat /etc/ssh/sshd_config

The system displays something similar to the following, indicating that the SSH connection will be disconnected after six consecutive wrong passwords are entered.

MaxAuth Tries 6

Note The MaxAuthTries parameter is not enabled by default. This parameter is used to limit the number of times a user can continuously enter incorrect passwords during each SSH login. If the number of wrong entries is exceeded, the SSH connection will be disconnected and a related error message will be displayed.

3. Modify the user login control parameters.

a. Open the SSH configuration file.

vi /etc/ssh/sshd_config

b. Modify the password retry policy according to business needs.

As shown below, add # before the policy configuration to cancel the password retry policy.

#MaxAuthTries 6

c. Press the Esc key and enter: wq to save the changes.

4. Run the following command to restart the SSH service.

systemctl restart sshd.service

Related Articles

Explore More Special Offers

  1. Short Message Service(SMS) & Mail Service

    50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00

phone Contact Us