What Do I Do If "Too many authentication failures for root" Is Reported When I SSH Into a Linux ECS?
Symptom
When an SSH client is used to remotely connect to a Linux ECS, the connection fails and the message "Too many authentication failures" is displayed.

Possible Causes
The password retry policy is configured in the SSH remote login configuration file (/etc/ssh/sshd_config). This error message is displayed when an incorrect password is entered for a specified number of consecutive times.
Solution
- Remotely log in to the ECS.
- Run the following command to check whether the sshd_config file contains the following configuration:
cat /etc/ssh/sshd_config
If information similar to the following is displayed, the SSH connection will be disconnected after you enter incorrect passwords for six consecutive times:
MaxAuthTries 6
The MaxAuthTries parameter is disabled by default. This parameter specifies the maximum number of consecutive incorrect password attempts allowed for each SSH login. If the number of consecutive incorrect password attempts exceeds the specified value, the SSH connection will be disconnected and an error message will be displayed.
- Run the following command to open the SSH configuration file and modify the user login control parameter:
- Press i to enter insert mode.
- Set MaxAuthTries to a large value or add a number sign (#) before the MaxAuthTries parameter.
- Modify the password retry policy:
MaxAuthTries 999
- Cancel the policy configuration:
# MaxAuthTries 6
- Modify the password retry policy:
- Press Esc to exit insert mode. Then, enter :wq to save the settings and exit.
- Restart the sshd service.
- CentOS 6: service sshd restart
- CentOS 7: systemctl restart sshd
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot