Changing default RDP port of Amazon EC2 server

First thing you should do if you are hosting a server in AWS cloud is to change its default ports.

Why one should do that?

  1. Does changing default port number actually increase security?
  2. The 5 biggest security mistakes users make in Amazon’s cloud
  3. AWS Security Alert: Insecure RDP Server Configuration

Steps to change the RDP port for EC2 server. YOU NEED TO PERFORM ALL BELOW STEPS IN THE SAME SEQUENCE ELSE YOU CAN LOSE SERVER/ RDP ACCESS.

1. Configure your Security Group and allow inbound access to the custom port you want to use for RDP (Say 7777). You can get more information about the Security Groups here.

Once done, next step is to open up the port 7777 from the server firewall so that external system can connect on this port.

You can manually open up the port from the Firewall settings or you can run following command if you have admin access.

netsh advfirewall firewall add rule name=Custom RDP Port dir=in action=allow protocol=TCP localport=7777

Last step is to change the RDP listening Port:

To change the port that Remote Desktop listens on, follow these steps.

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:

322756 How to back up and restore the registry in Windows
  1. Start Registry Editor.
  2. Locate and then click the following registry subkey:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
  3. On the Edit menu, click Modify, and then click Decimal.
  4. Type the new port number(7777 in our case), and then click OK.
  5. Quit Registry Editor.
  6. Restart the computer.

Posted

in

by

Tags:

Comments

Leave a Reply

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