How to change RDP port in windows

RDP Tutorials VPS Web Tutorials Windows

October 14, 2019 by Harry

How to change RDP port in windows

The default RDP port is 3389. Since this port is well known and can be used to attack servers, it’s better to be changed.
Here are the steps to change the RDP port:

  • Choosing a new port number.
  • Adding the new port number to the firewall in order to accept the connection.
  • Changing the port in a windows registry setting.
  • Connecting through the new port to your server.
  1. Choosing A New Port Number

    The range between (0-1023) is for system ports and (1024-49151) is for user ports that have been given to the applications so it’s better to choose an RDP port number between range (49152-65535) but it’s ok if you also find a free number between (1024-49151).

    Note: in this topic, we have chosen port number 7952.


  2. Add The New Port Number To The Firewall In Order To Accept The Connection

    Now you should open your chosen port number in the Windows firewall in order to let the firewall accept the connection from that port.
    This section has been completely explained on OPEN A PORT topic.


  3. Changing The Port In The Windows Registry Setting

    Once you opened the port in the firewall, you should change the port number in the registry setting.
    Open the RUN windows using Windows key + R, type regedit and click OK.
    On the new window, navigate to the below path:

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

    RDP port
    Click on RDP-Tcp, find PortNumber on the right section and double click on it.
    In this section, put the base on decimal and change the 3389 to your desired port number and click OK.
    Note: Close the registry and restart your server.

    The next time you connect to this server by using the Remote Desktop connection, you must type the new port.









About the Author Harry

I like to learn and to teach to make things easier

Leave a Reply

Your email address will not be published. Required fields are marked *