Causes
Port conflict: The default Remote Desktop Protocol (RDP) port,
3389, is in use by another application.Security protocol negotiation failure: The client and server cannot agree on a security protocol for the RDP session.
Solutions
To prevent being locked out by a misconfiguration, first create a snapshot of the system disk to back up your data before you continue.
Step 1: Check for and resolve port conflicts
Another application may be using the default RDP port, 3389.
Log on to an ECS instance using a VNC connection.
Go to ECS console - Instance. In the top navigation bar, select the target region and resource group.
Go to the details page of the target instance. Click Connect and select VNC. Enter the username and password to log on to the ECS instance.
Check the port status.
Search for and open PowerShell from the taskbar. Run the following command to find the Process ID (PID) of the process using the remote port (default
3389).netstat -ano | findstr :3389Replace
<PID>with the Process ID from the previous step to identify the corresponding application.tasklist |findstr <PID>
Analyze the results and take action.
Normal: The process is
svchost.exe. This is the expected behavior, and the port is not occupied by another application. Skip to Step 2: Check and adjust the security protocol.Abnormal: The process is another application. You must change the default RDP port.
Change the default RDP port.
Choose a new port: We recommend selecting an unused port in the range of
10000to65535. You can run thenetstat -ano | findstr :<PortNumber>command in PowerShell to check if the target port is in use.Modify the registry:
In the taskbar search box, type
regeditand open the Registry Editor.In the left navigation pane, navigate to . In the right pane, find and double-click PortNumber.
For the Base option, select Decimal. Change the Value Data to the new port number you selected.
Restart and test:
On the instance details page, click Restart to apply the changes. After the instance restarts, click Connect and select Workbench.
In the Instance Login window, select Terminal, click More Options, and enter the new port number in the Port field.
ImportantYou must specify the new port each time you connect after changing the default RDP port. Alternatively, if the conflicting process can be safely terminated, run the
taskkill /f /pid <PID>command to end it. This frees the default port, eliminating the need to specify a new one for each connection.
Step 2: Check and adjust the security protocol
Search for
gpedit.mscand open the Local Group Policy Editor.Navigate to . In the right pane, find and double-click Require use Of specific security layer for remote (RDP) connections.
In the Require use Of specific security layer for remote (RDP) connections dialog box, select Enabled. From the Security Layer drop-down list, select RDP.
Click OK to save the settings and try to connect again.