In all Windows versions, the default Remote Desktop Port (RDP) is 3389 (TCP/UDP). But if you want to better protect your computer against attacks, I recommend that you change the default RDP port number 3389 to another number.
Microsoft Remote Desktop is an app that allows you to access and manage the resources and data of a remote computer (host computer) over an Internet connection. It is, in essence, remote control software. Remote Desktop allows you to access a work computer from home, regardless of whether the work computer connects to a network or not.
When you begin a remote desktop session, the client computer sends a signal over the Internet to the host computer via a standard “listening” port 3389 asking for permission to connect and log in. The host computer responds with a request for your login information, which is checked against a list of Remote Desktop users using an internal authentication process.
Once you log in, display data and keyboard keystrokes are sent from the host to the client computer, so you can view and interact with the host computer as if you were sitting right in front of it.
Change Remote Desktop port number
To change the default Remote Desktop port (3389) to a different port number, open the registry editor. In the search bar or using the magnifying glass, search for: regedit. Open the registry editor.
In the registry editor navigate to the following key:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
Double-click on “PortNumber”. Then click on Decimal. Enter a new port number for Remote Desktop.
close the Windows registry editor off.
After you change the Remote Desktop port in the Windows registry, you must allow incoming traffic on the new RDP port in Windows Firewall.
In the Windows search bar, use the magnifying glass. Search for: Firewall. Click on the Windows Defender Firewall result.
Click on Advanced settings in the menu on the left.
Click on Inbound Rules and then right-click: New Rule.
The rule type click on Port.
Then click on TCP or UDP (TCP first then repeat the step again for UDP) and click on Specific Ports. Enter the new Remote Desktop port number.
Click on Allow the connection.
Click on all three options, domain, private and public.
Give the new Windows Firewall rule a meaningful name.
Click finish.
You have now successfully changed the port number of Windows Remote Desktop. You must restart the computer. The next time you try to connect via remote connections from another computer, enter: IP number:NEW-PORT-NUMBER.
For instance: 192.168.178.1: 3399.
I hope this helped you. Thank you for reading!