1

I have successfully made an AMI and able to launch instances from this image from my AWS account successfully. However, as soon as I try to launch an instance from this AMI from some other AWS account specifying keypair other than whats in the AMI authorized_keys already, it doesn't let me login to instance with the new keypair(for obvious reasons). I am assuming that i need to implement some sort of mechanism to download the custom keypair specified in the instance creation wizard of Amazon AWS into the authorized_keys of the newly created instance.

Looking for hints on how this can be achieved !!

Thanks.

1 Answer 1

2

Take a loot at https://help.ubuntu.com/community/CloudInit.

You need to set up the AMI with it and it will update the authorized key.

It's also available at other distros.

You can also make a script (for instance rc.local) and grab the value at:

curl http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key 

Amazon exposes lots of information through metadata.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.