I've joined a company that started migrating to AWS, but it seems that when they created the instances, they didn't generate key pairs. Right now, I can only connect via SSH. I want to set up Fleet Manager or RDP connections for better troubleshooting if issues arise. Is there a way to create and apply a key pair to existing instances so that I can retrieve the admin password and access the system through the EC2 console instead of relying on the EC2 serial console? Just to clarify, I'm working with a Windows-based environment using Server 2019 and 2022.
2 Answers
You can definitely use a user data script to add your public SSH key to the machine's authorized keys. Just reboot the instance afterward, and you should be all set!
For your Windows instances, you actually don't need a key pair. You can manage local Windows users and groups through Fleet Manager. Just create a new user, add it to the administrators group, and then you can RDP using Fleet Manager!

Can you share a guide on how to do that? Fleet Manager's greyed out for me, and I think I’ll need to adjust some security groups and VPC settings first.