How to Change the RDP Port for a Windows Server?

In this era, security is a big question for all the orgnization. By default the RDP port is 3389 and to secure the first thing that come to our mind that is there a way that we can modify the port for the RDP access to add an extra layer of security.

Port numbers in computer networking represent communication endpoints. Ports are unsigned 16-bit integers (0-65535) that identify a specific process or network service. IANA is responsible for internet protocol resources, including the registration of commonly used port numbers for well-known Internet services.

  1. Well Known Ports: 0 through 1023.
  2. Registered Ports: 1024 through 49151.
  3. Dynamic/Private : 49152 through 65535.

TCP ports use the Transmission Control Protocol, the most commonly used protocol on the Internet and any TCP/IP network. TCP enables two hosts to establish a connection and exchange streams of data. TCP guarantees delivery of data and that packets will be delivered in the same order in which they were sent. Guaranteed communication/delivery is the key difference between TCP and UDP.

UDP ports use the Datagram Protocol. Like TCP, UDP is used in combination with IP (the Internet Protocol) and facilitates the transmission of datagrams from one computer to applications on another computer, but unlike TCP, UDP is connectionless and does not guarantee reliable communication; it's up to the application that received the message to process any errors and verify correct delivery. UDP is often used with time-sensitive applications, such as audio/video streaming and realtime gaming, where dropping some packets is preferable to waiting for delayed data.

Changing the RDP from Registry first

Press “Windows + R” to open the Windows Run dialog. Type “regedit” in the Run box and press Enter to open Windows Registry Editor.

Once the wizard open navigate to the below location:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber

Right click on PortNumber and Edit > Select Decimal Type > Create a new port number that you want, and then click OK.

Changing the RDP From Firewall

The newly set RDP port must be open in the firewall before it can be used. About how to open a port in Windows Firewall, please refer to

Changing the RDP from PowerShell

  1. Open PowerShell as an administrator
  2. Run this command Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name 'portnumber' -Value XYZ

Once all this is done, we need to restart the Remote Desktop Service to get that affective. And, now to access through RDP we need to make a bit change that is abc.india.com:portnumber

Related Posts:

0 Comments: