How to Change Password of IAM User in AWS?

How to Change Password of IAM User in AWS

In this blog, we'll learn how to change the password of an IAM user in AWS using console and AWS CLI.

AWS IAM (Identity and Access Management) is a service that manages the access-related operations, such as creating users and groups, configuring permissions, and managing login credentials.

💡
Note: Not everyone can reset the IAM User password. Only a user who has the iam:UdateLogingProfile permission or has the admin privileges only can do it. So if you are not an admin, contact the admin or who has privileges to reset the password.

Reset AWS IAM User Password

There are two methods to reset the IAM user password.

  1. From AWS console
  2. Use the CLI

Method 1: Resetting Password from AWS Console

Log in to the AWS console as a privileged or admin user.

Open the IAM dashboard and click to open the Users tab from the left side panel under the Access management.

Listing IAM user from the AWS IAM console

Select the user for whom you want to reset the password.

On the next page, select the Security credentials tab

selecting the secrity credentials of the IAM user to modify the users' console access

Selec the Manage console access tab from the "Console sign-in" section.

selecting the manage console access to change the configuration of the consoel access to reset the passoword

On the next page, choose Reset password and select the Autogenerated password To create a temporary password, also allow the user to log in with it and reset their password to the intended one.

selecting the resetting password option to to reset the IAM user credentials

Share the temporary credentials to the user to login.

downloading the temporary IAM user credentials to provide to the user for the login

The user will be prompted to set a new password on their first login.

Method 2: Reset IAM User Password Using the AWS CLI

Here, the CLI also has to be configured with the admin credentials, such as Secret Key and Secret Access Key.

The cli output of the aws cli configuration with the user credentials

To reset the password from the CLI, use the following command.

aws iam update-login-profile \
    --user-name <IAM_USER_NAME> \
    --password <NEW_PASSWORD> \
    --password-reset-required

Replace the <IAM_USER_NAME> and <NEW_PASSWORD> with the actual values.

Note: To avoid the security breaches, always use a password rotation policies, enable MFA, monitor user activities using CloudTrail and mainly not providing admin credentials.
About the author
Arun Lal

Arun Lal

Arun Lal is a DevOps Engineer & AWS Community Builder, also an Expert in AWS infrastructure, Terraform automation, and GitLab CI/CD pipelines.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to DevOpsCube – Easy DevOps, SRE Guides & Reviews.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.