RDP(Remote Desktop Protocol) is a proprietary protocol developed by Microsoft. When you connect the computer, the remote desktop feature "listen" the connection request by default on port 3389.
You can change the RDP listening port on Windows computers/servers by modifying the registry. Use the below steps to change the default RDP port.
- Start the registry editor (Type regedit in the Search box.) or type regedit in Run and click on OK.
- Navigate to the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber
- Click Edit > Modify, and then click Decimal.
- Type the new port number above 1024, and then click OK.
- Close the registry editor, and restart your computer/server.
To connect the RDP using the new port, you need to enter IPADDRESS:PORT in computer address.
For security reasons, it's better to change the default RDP port and whitelist the IP address in your firewall for the RDP connection.