All Products
Search
Document Center

:What do I do if the error message "The connection was denied because the user account is not authorized for remote login" appears when I connect to a Windows instance by using Remote Desktop?

Last Updated:Oct 09, 2024

This topic describes how to resolve the issue that the following error message appears when you connect to a Windows Elastic Compute Service (ECS) instance by using Remote Desktop: The connection was denied because the user account is not authorized for remote login.

Problem description

You cannot connect to a Windows ECS instance by using Remote Desktop and receive the following error message: The connection was denied because the user account is not authorized for remote login.

Cause

The preceding issue may be caused by incorrect configurations of permissions on Windows Remote Desktop. You can use one of the following solutions to resolve the issue:

Solutions

Use one of the following solutions based on your business requirements. In this example, an ECS instance that runs Windows Server 2019 or later is used.

Solution 1: Troubleshoot the User Rights Assignment settings in the group policy

  1. Connect to the Windows ECS instance by using Virtual Network Computing (VNC).

    For more information, see Connect to a Windows instance by using a password.

  2. Click the Type here to search box in the lower-left corner of the instance desktop, enter run, and then press the Enter key. In the Run dialog box, enter secpol.msc and click OK to open the Local Security Policy window.

    image

  3. Choose Local Policies > User Rights Assignment > Allow log on through Remote Desktop Services.

    Check whether the Remote Desktop Users group exists.

  4. (Optional) If the Remote Desktop Users group do not exist, click Add User or Group to add the group. Then, click OK. image

Solution 2: Troubleshoot the user group attributes of your user

  1. Connect to the Windows ECS instance by using VNC.

    For more information, see Connect to a Windows instance by using a password.

  2. Click the Type here to search box in the lower-left corner of the instance desktop, enter run, and then press the Enter key. In the Run dialog box, enter lusrmgr.msc and click OK to open the Local Users and Groups window.

    image

  3. In the left-side navigation pane, click Users. Double-click the username that you used in the failed attempt to connect to the instance.

  4. In the user properties window that appears, click the Member Of tab. Make sure that the user is a member of the user group that is granted the remote logon permissions in Solution 1: Troubleshoot the User Rights Assignment settings in the group policy, as shown in the following figure. image

  5. (Optional) If the user group does not exist, click Add to add the user group. Then, click OK.

  6. In the user properties window, click the Remote control tab. Make sure that Enable remote control is selected, as shown in the following figure.

    image