"Logon failed. Password-based logon is not allowed" error
This topic describes the causes of and solutions to the Logon failed. Password-based logon is not allowed error when you remotely log on to an ECS instance from Workbench.
Symptoms
When you use a password to remotely log on to an ECS instance from Workbench, the following error is reported: Logon failed. Password-based logon is not allowed.
A dialog box appears and lists three possible causes: password-based logon is disabled in the operating system, a password was not set when the instance was created, or your account has an overdue balance when you log on by using a public IP address. You can click Connect to the instance by using VNC or Log On Again.
Causes and solutions
The error may occur for one of the following reasons:
-
No password was set when the ECS instance was created: You can reset the logon password for the ECS instance. For more information, see Reset the logon password of an instance.
-
Your account has an overdue balance: If you use a public IP address to log on, an overdue balance on your account can also prevent you from logging on. You can log on by using a private IP address, or settle your overdue payments and try again. For more information, see What do I do if my account has an overdue payment?.
-
A key pair is bound to the ECS instance: After a key pair is bound to the instance, password-based logon is automatically disabled. To enable password-based logon, reset the instance password or modify the SSH configuration file. For more information, see Reset the logon password of an instance or Modify the SSH configuration file.
Modify the SSH configuration file
Log on to the instance by using VNC and modify the SSH configuration file to resolve this issue.
-
Verify that the
PasswordAuthenticationparameter is set toyesin the/etc/ssh/sshd_configfile.sudo cat /etc/ssh/sshd_config -
If the
PasswordAuthenticationparameter is set tono, password-based logon is disabled. You must change the value toyes.-
Open the SSH configuration file.
sudo vim /etc/ssh/sshd_config -
Press
ito enter Insert mode, and change thePasswordAuthenticationparameter toyes. -
Press the
Esckey, enter:wq, and then pressEnterto save the configuration file.
-
-
Restart the sshd service to apply the changes.
sudo systemctl restart sshd.service -
Log on to the ECS instance by using password authentication. A successful logon confirms that the issue is resolved.
For more information, see Log on to a Linux instance by using Workbench.