Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was given AWS Console access to an account with 2 instances running that I cannot shut down (in production). I would however like to gain SSH access to these instances, is it possible to create a new Keypair and apply it to the instances so I can SSH in? Obtaining the exisiting pem file for the keypair the instances were created under is currently not an option.

If this isn't possible is there some other way I can get into the instances?

share|improve this question
Duplicate of:… – RickyA Jan 6 '14 at 9:58

  1. Launch a new instance
  2. Detach root device from locked instance (must be EBS)
  3. Attach root device for locked instance to new instance
  4. Logon to new instance, mount attached device, replace .ssh/authorized_keys with that of the new instance (or whatever)
  5. Unmount, detach, reattach
share|improve this answer

Just to provide another option in case somebody reads this: If the instances are managed via some kind of configuration management system, like Puppet or Chef, you can use that to push new keys to the running instance.

share|improve this answer

Unless the AMIs used have a "backdoor" (which you can add on custom AMIs but is definitely not a good idea security wise and by backdoor I mean a pre-set private key and/or password authentication enabled) you're stuck unless you have the PK for the keypair used on those instances. Your only choice is to start-up new instances with a new keypair.

Sorry I couldn't give you the answer you wanted.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.