When I create a AWS EC2 instance, I do not find the option to select the key pair that I want. The “Create Instance” method provides pretty much every other option but not the option to select the Key Pair. Once the EC2 instance is created, I notice that the instance is created with a key pair from the key pair list already available in Morpheus. I would like to know how to select the specific key pair I want during instance creation.
Thanks.
When provisioning to AWS Morpheus uses its own key pair to provision the instance. If you are looking to add your own public key to the instance during provisioning you should be able to add the key to your user settings for Linux. Then during provisioning if add current user is selected it should add that key. You could also do this in a post provisioning task if you want the same key added to all instances provisioned.
Hello Bob,
Thank you for the response. Based on your instructions, I performed the below actions
- Created a new keypair under Infrastructure->Trust
- Added the newly created keypair in my User Profile in Administration->Users->My Profile->Edit-> Linux Settings
- Created a User Group Administration->User Groups
- Added my User Profile under the User Group.
- During EC2 provisioning, selected the new User Group in the Configure->User Config section. Created the instance.
I noticed that the instance is still created with a different key pair and not the one I created in Step 1. You mentioned “add current user” in your response, however I could not find such an option during the Create Instance flow.
Could you please help me here?
Regards,
Vineeth.
Hi Vineeth - I probably should have been more clear. This process will not replace the key pair used to provision the instance as Morpheus will need this. What it does do, is add the key set on your users settings to the authorized_keys file in the OS direct. Below is a screenshot from my AWS instance authorized_keys file showing both the Morpheus key and also my key for the test user that was added. In my case from adding the user group at provisioning time.
The add current user I was referring to is actually “Create your user” checkbox. This is typically automaticaly checked if you have user settings in your user profile.