"Logon failed. Password-based logon is not allowed" error

Updated at:
Copy as MD

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.

  1. Connect to an instance by using VNC.

  2. Verify that the PasswordAuthentication parameter is set to yes in the /etc/ssh/sshd_config file.

    sudo cat /etc/ssh/sshd_config
  3. If the PasswordAuthentication parameter is set to no, password-based logon is disabled. You must change the value to yes.

    1. Open the SSH configuration file.

      sudo vim /etc/ssh/sshd_config
    2. Press i to enter Insert mode, and change the PasswordAuthentication parameter to yes.

    3. Press the Esc key, enter :wq, and then press Enter to save the configuration file.

  4. Restart the sshd service to apply the changes.

    sudo systemctl restart sshd.service
  5. 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.