This article describes how to troubleshoot remote login failures caused by port problems.
The following uses a CVM instance running Windows Server 2012 as an example to describe the steps.
You can use the following tools to check if the login issues are related to ports and security group configurations:
If the problem is indeed a security group configuration problem, use Open all ports in the Security group (port) helper to open related ports and try to log in again. If you still cannot log in after opening the ports, refer to the following for troubleshooting.
Checking network connectivity
You can use the Ping command to test network connectivity from your PC. You should run the test from computers in different network environments (such as different IP ranges or ISPs) to check whether it is a local network problem or a server problem.
- Open the command line tool on your local computer.
- Windows: Click Start -> Run and enter cmd. A Command Prompt window appears.
- MacOS: Open a Terminal window.
- Run the following command to test network connection.
ping + CVM_Instance_public_IP_address
- If you see results similar to what is shown in the following figure, your network connection to the CVM instance is normal. In this case, check the remote desktop configuration.
- If Request Timeout appears, your network connection to the CVM instance is not working properly. In this case, refer to Instance IP Address Ping Failure for troubleshooting instructions.
- Run the following command to check whether the remote port is open.
telnet CVM_instance_public_IP_address port_number
telnet 139.199.xxx.xxx 3389, as shown in the following figure:
If you see a black screen with only the cursor, that indicates the port (3389) is open. For the next step, check whether remote desktop service is enabled on the instance.
If the connection fails, as shown in the following figure, that means a network exception occurred. Check the corresponding part of the network.
Checking remote desktop configuration
Logging in to the CVM instance using VNC
It is recommended that you use VNC to login only if the standard login methods fail.
- Log in to the CVM Console.
- Select the desired CVM and click Log In, as shown in the following figure:
- The Log into Windows instance page appears. Select Alternative login methods (VNC) and click Log In Now to log in to the CVM instance.
- The log in page appears. Select Send Ctrl-Alt-Del in the top left corner and click Ctrl-Alt-Delete to enter the system login interface, as shown in the following figure:
Checking if remote desktop is enabled on the CVM instance
- Log in to the CVM instance. Right click This Computer from the Desktop and select Properties to open the System window.
- In the System window, select Advanced System Configurations to open the System Properties window.
- In the System Properties window, select the Remote tab. Check whether Allow remote connections to this computer under Remote Desktop is selected, as shown in the following figure:
- If it is selected, remote connection is enabled. Next, you should check whether remote access ports are open.
- If it is cleared, select Allow remote connections to this computer and try to connect to the instance again.
Checking whether remote access ports are open
- Log in to the CVM instance. Click to open a Windows PowerShell window.
- In the Windows PowerShell window, run the following command to check the status of remote desktop (by default, the remote desktop uses port 3389).
netstat -ant | findstr 3389
Checking whether the remote desktop ports in registry are consistent
This section describes how to check the values of TCP PortNumber and RDP Tcp PortNumber. They must be the same.
- Log in to the CVM instance, click , select , and enter regedit. Press Enter to open the Registry Editor window.
- In the navigation pane on the left, expand the following directories: HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Control -> Terminal Server -> Wds -> rdpwd -> Tds -> tcp.
- Locate the PortNumber in tcp and record the port number (3389 by default), as shown in the following figure:
- In the navigation pane on the left, expand the following directories: HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Control -> Terminal Server -> WinStations -> RDP-Tcp.
- Locate PortNumber in RDP-Tcp and check whether the PortNumber value in RDP-Tcp is the same as the one in tcp, as shown in the following figure:
- Double click PortNumber in RDP-Tcp.
- In the dialog box that appears, modify Value Data to an unoccupied port number between 0 - 65535. Ensure TCP PortNumber and RDP Tcp PortNumber are the same, and click OK.
- Restart the instance using the CVM Console, and try to remotely connect to the instance again to check whether the connection is successful.
Restarting remote desktop
- Log in to the CVM instance. Click and select . Enter services.msc and press Enter to open the Services window.
- In the Services window, right-click Remote Desktop Services and select Restart to restart the remote desktop service, as shown in the following figure:
If All Else Fails
If you are still unable to remotely log in after performing the above-mentioned steps, submit a ticket for further assistance.