- Newest
- Most votes
- Most comments
Here's the content you should insert into the .reg file to set the RDP port back to the original value (3389):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]
"PortNumber"=dword:00000d3d
Follow these steps:
1.Open Notepad or any text editor.
2.Copy the above content and paste it into the text editor.
3.Save the file with a .reg extension, for example, rdp_port_original.reg.
4.Transfer this .reg file to your Windows instance.
5.Double-click on the .reg file to import it into the Windows registry. You may be prompted to confirm the action.
After importing the .reg file, the RDP port should be set back to the default value (3389). Then, you can re-enable the Windows Firewall rule for Remote Desktop using the steps I mentioned earlier:
netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes
Run this command in Command Prompt to enable the Remote Desktop firewall rule.
Once you've completed these steps, you should be able to access RDP on the default port (3389) again.
Hi,
I responded on your original post here. But posting here too for the community.
The PowerShell commands to reset those changes should be as follows :
(I did not find any property named HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal, hence there's no line related to that in the below commands)
<powershell>
$portvalue = 3389
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value $portvalue
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
</powershell>
<persist>true</persist>
You would add this to the launch-script while creating a new instance from the snapshot of your locked-out instance.
The password for this new instance will be same as that of your old instance (but will not be accessible to Lightsail for the browser-based-RDP client because the snapshot was created without Windows Sysprep
, so you will need to enter it manually). If you have NOT customized the password, please make sure to note the default password of the original instance before deleting it.
Thanks.
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 20 days ago
- AWS OFFICIALUpdated 8 months ago