Change RDP port on Amazon EC2

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




2. Configure Windows Firewall, run following command if you have admin access.

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

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

Start Registry Editor.
Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
On the Edit menu, click Modify, and then click Decimal.
Type the new port number(7777 in our case), and then click OK.
Quit Registry Editor.
Restart the computer.

Comments