Need to Update Lost SSH Key - Root Volume on Stopped Instance will not Force Detach

0

I have an EC2 instance with a Root volume that has an SSH key that I do not have. It was created by a previous administrator. I have researched updating the key and the best approach is to unmount the volume and remount it to an instance that I do have access. My Linux knowledge is fairly good, so if I can get the volume mounted on another server, I should be in good shape. I have stopped (but not terminated) the affected instance. I have tried a regular and forced volume detachment and they are failing.

gefragt vor einem Monat572 Aufrufe
1 Antwort
0
Akzeptierte Antwort

SOLVED I worked with AWS Support and there is a new option available for force changing the key by simply shutting down the instance, adding a script, and restarting the instance. Details can be found here:

https://repost.aws/knowledge-center/user-data-replace-key-pair-ec2

In Step #6, replace the name "username" with the name of the user that needs to be updated (I was working with ec2-user) and replace the name "PublicKeypair" with the public key that you want that user to have on the instance. In my case, I had a known key pair that I could use.

Brillant solution with no unmount/remount of a volume.

beantwortet vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen