With more people using remote servers, it is now easier for hackers to hack into the system through the RDP port. The default port number is 3389, and most people keep it the same without finding the need to change it. Now, this default RDP port is already on the hackersโ€™ radar, and they always try to get access to the remote computers through it.ย 

Once the hackers are in, your computer will be vulnerable to their attacks, and they may steal your data, track your activity online, and do things that one cannot even think of. You can change your default RDP port number for a Windows Server to something else to avoid it.ย 

But what will changing the RDP port do? The hacker always considers the RDP port 3389 because it is the default. But if your RDP port is changed and set to some other free port, then it will be difficult for them to know whatโ€™s your RDP port and gain access to the PC. This article will guide you through how to change the RDP port for a Windows server.ย 

Ways to Change RDP Port for a Windows Server

There are multiple ways to change the RDP port for a Windows Server. Though the process is quite easy, you will have to be careful while doing so. Follow the steps given below to change the RDP port-

1. Through Registry Editor

The first way to change the RDP port is through the Registry Editor. You can do it by following the steps given below-

  1. Open theย Start Menu, search forย Registry Editor, and open it. Registry-Editor from search bar
  2. Now, navigate to the following address-
    • HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
  3. On the right side, double-click onย PortNumberย to edit it.ย 
  4. Here, selectย Decimalย underย Base.ย 
  5. Now, you will have to edit theย Value Data. Set theย Value Dataย to the RDP port you want to change to. Through Registry Editor
  6. Once done, click onย OKย to save the changes.ย 

2. Through PowerShellย 

You can also run the PowerShell command to change the RDP port for the Windows server. To do so, follow the steps given below-

  1. Press theย Windowsย key and typeย Windows PowerShell. Right-click on theย Windows PowerShellย and then click onย Run as Administrator. type Windows PowerShell
  2. When the UAC prompt appears, click on theย Yesย button.ย 
  3. In the Windows PowerShell, execute the following command-
    • Set-ItemProperty -Path โ€˜HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcpโ€™ -Name โ€˜portnumberโ€™ -Value [Port Number]

Note-ย You must replaceย [Port Number] with the port number you want to change.ย 

Implement the Changes in the RDP Port

You must implement the changes once you have changed the RDP port through the above steps. Configure the Windows firewall for the latest Port and restart the remote desktop services. Hereโ€™s how-

  1. Press theย Windows key, type Windows Defender Firewall with Advanced Security, and pressย Enter. Windows Defender Firewall with Advanced Security
  2. Click on theย Inbound Rulesย and then click onย Newย Rule. Inbound Rulesย and then click onย Newย Rule
  3. For theย Rule Type, selectย Portย and then click onย Next. Rule Type, selectย Portย and then click onย Next
  4. When asked, โ€˜Does this rule apply to TCP or UDP?โ€™ selectย TCP.
  5. Selectย Specific local ports, type the new RDP port you have set, and then click onย Next. Specific local ports
  6. On the next screen, selectย Allow the connectionย and then continue by clicking onย Next. Allow the connection
  7. Please select whether the rule applies to Domain,ย Private,ย Public, or all of them. Domain,ย Private,ย Public
  8. You must now enter the Nameย for the RDP port and description (optional). Click onย Finishย once done.ย 
  9. We selectedย TCP in the fourth step above; once you have set the rule for TCP, follow the above steps again, but chooseย UDPย instead of TCP.
  10. Press the Windows + Rย key combo, typeย services.msc, and click OK. search for services
  11. Search forย Remote Desktop Servicesย here. Right-click on this service, and then click onย Restart.ย 

How to Check the RDP Port on Windows Server?

Once you have changed the RDP port, it is important to check whether the changes have been made. You can do this by following the steps given below-

  1. Launchย Windows PowerShellย as Administrator on your PC. type Windows PowerShell
  2. In the PowerShell, you must execute the command given below-
    • Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber"

Note-ย Look for theย PortNumberย here. The PortNumber should be the one you have set using the above steps; if it is, you have successfully changed the RDP port.ย 

Final Words

Once you have followed the above steps, the RDP port on the Windows server will be changed to the custom port instead of the default. Ensure you have followed all the steps carefully and not skip them. You can now use the new port to use the Remote Desktop Connection.ย 

LEAVE A REPLY

Please enter your comment!
Please enter your name here