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

I have an EC2 instance running with a keypair that I don't have access to the private key of.

I am currently accessing the instance freely thanks to having the public key of my own custom keypair added to the ~/.ssh/authorized_keys on the instance.

Now I would like to rebundle the running instance into a new AMI, and I was following the instructions here: http://alestic.com/2009/06/ec2-ami-bundle

However, since I do not have access to the same private key as currently defined for the instance, I wonder:

  • which private key I should upload to /mnt on the instance? (actually, I don't fully understand what the private key is required for, if all that the bundling does is process the local state of the instance "disk" into the local files of the bundle)

  • if I do not exclude my home directory with its .ssh, will I be able to launch and connect to the instance even if I don't have the instance private key for it?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The AWS private key is associated with your X.509 certficate; it isn't the same as an SSH private key. See this summary of AWS security credentials.

The X.509 certificate is associated with your AWS account rather than with individual EC2 instances; if you start a new instance using your custom AMI, it will be associated with the X.509 certificate and private key defined in your account.

If you also have an authorized_keys file containing your personal SSH public key bundled into the AMI, you should be able to log in with your own SSH key - this is independent of the X.509 certificate, which is used to authenticate AWS API calls.

share|improve this answer
Thanks! _________ –  GJ. Feb 2 '11 at 19:44
@gareth_bowles does the .pem file contain the X.509 certificate? –  codecowboy Apr 9 '14 at 11:15

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.