Allow AWS IAM User to Create Access Keys and Upload SSH public keys

This short tutorial will show AWS Cloud Administrators how to create an IAM policy that gives cloud users permissions to generate their own Access Keys and SSH Keys. We will also include permission to change password without contacting Admin for such basic requests.

For this you need to create an IAM policy under IAM > Policies > Create policy.

Here is the policy json code to use.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "iam:ListUsers",
                "iam:GetAccountPasswordPolicy"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "iam:*AccessKey*",
                "iam:*SSHPublicKey*",
                "iam:ChangePassword",
                "iam:GetUser",
                "iam:*ServiceSpecificCredential*",
                "iam:*SigningCertificate*"
            ],
            "Resource": [
                "arn:aws:iam::*:user/${aws:username}"
            ]
        }
    ]
}

See below screenshot of the same.

Review the policy and agree to create if all looks good.

You can then attach the policy to a user group or directly to an IAM user account.

You can now ask the users in a group attached to policy if they’re able to generate Access and SSH keys.

Similar guides:

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Unlock the Right Solutions with Confidence

At CloudSpinx, we don’t just offer services - we deliver clarity, direction, and results. Whether you're navigating cloud adoption, scaling infrastructure, or solving DevOps challenges, our seasoned experts help you make smart, strategic decisions with total confidence. Let us turn complexity into opportunity and bring your vision to life.

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

Rook is a robust and open source solution used to orchestrate distributed storage systems, particularly in cloud native environments. The […]

s5cmd is a CLI utility used to access S3 bucket and manage files – upload, or delete objects in an S3 […]

Ceph is an enterprise-grade, and open-source software-defined storage solution backed by Red Hat. It is designed for reliability, scalability, and […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.