Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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: stackoverflow.com/questions/3260739/… –  RickyA Jan 6 at 9:58

3 Answers 3

https://forums.aws.amazon.com/thread.jspa?threadID=46776&tstart=45#179656

  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

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

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

Your Answer

 
discard

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.