3

I added a user to a group in amazon AWS. The user has the privilege of adding EC2 instances but does not appear to have the privilege of creating a keypair - the request is getting denied. Any idea on what privilege needs to be added to enable this feature for the new user?

6
  • 1
    The most secure option is to have each user generate their own ssh keypair (ssh-keygen) and then import the public key into the AWS console. Commented Aug 27, 2016 at 18:34
  • yes, agreed. I am curious why I do not have the privilege of creating a keypair using AWS - what privilege am I missing? Commented Aug 27, 2016 at 18:35
  • I don't know, and I don't have access to the AWS docs at the moment. My comment, though, is that your users should generate their own keys outside of AWS and then import the public key Commented Aug 27, 2016 at 18:38
  • @EEAA I think he's saying there's an IAM privilege required to do the actual import. Commented Aug 27, 2016 at 18:39
  • @ceejayoz Ahh, sure. Commented Aug 27, 2016 at 18:40

2 Answers 2

7

The specific IAM permission required is ec2:ImportKeyPair.

{ "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1472323724000", "Effect": "Allow", "Action": [ "ec2:ImportKeyPair" ], "Resource": [ "*" ] } ] } 
1
  • 2
    +1. Much better than the administrator option. :) Commented Aug 27, 2016 at 18:55
-2

I was missing the administrator policy for the user. Once added in AWS, the new user could then import keypair or generate a new one. Hope this helps.

4
  • Note: This gives them a lot of other privileges. See my answer if you want to limit to just that particular ability. Commented Aug 27, 2016 at 18:50
  • (I didn't downvote you, though) Commented Aug 27, 2016 at 18:55
  • its fine to downvote as long as someone actually gives a helpful answer - I do not care about the points here. Thank you for the answer Commented Aug 27, 2016 at 19:00
  • 3
    The downvote was from me. While this answer theoretically does solve the problem, it solves it in perhaps the worst way possible: giving the user full administrative access to your AWS account. @ceejayoz's answer above is much better. Commented Aug 27, 2016 at 20:33

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.