- Newest
- Most votes
- Most comments
Just in case someone needs this for solution. This is what I did to gain back my instance
- Take a snapshot of the current locked out instant
- Create a new instance from that snapshot. During this instance creation step, there is an option to launch script. In that you can add powershell script to change back to port 3389. The script is like this
<powershell>
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\" -Name PortNumber -Value 3389
</powershell>
<persist>true</persist>
- After your instance created, try to log in your server with the RDP with default port 3389
- After that, delete your old instance and move your static IP to new instance.
That's it. You will get your server back.
Hi,
The Lightsail in-Browser RDP attempts RDP connection only on port 3389. So you won't be able to use that to establish a RDP connection on any other port.
If you are also unable to establish a remote desktop connection via your own client, one option to recover data from the instance would be to create a snapshot of the instance [1] and a new instance from that snapshot [2] which would hopefully start with 3389 as the RDP port again. [Update: while creating this new instance please check if the launch-script shared by delphiman
here works to reset the RDP port]
If the new instance also doesn't default back to RDP port as 3389, then the only way to recover data from the instance is to create a snapshot of it's root disk, create a new volume from this disk-snapshot and copy data over from that new volume attached to a recovery new instance [3].
Docs:
[1] Create instance snapshot - https://docs.aws.amazon.com/lightsail/latest/userguide/prepare-windows-based-instance-and-create-snapshot.html
[2] Create a new instance from that snapshot - https://docs.aws.amazon.com/lightsail/latest/userguide/lightsail-how-to-create-instance-from-snapshot.html
[3] Create a root disk snapshot - https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-create-an-instance-root-volume-snapshot.html
Thanks
Relevant content
- asked 9 months ago
- asked a year ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
Glad you found the powershell tweak needed in addition to the steps from my response to work.