Set an initial password for an IAM user - AWS Command Line Interface

Set an initial password for an IAM user

This topic describes how to use AWS Command Line Interface (AWS CLI) commands to set an initial password for an AWS Identity and Access Management( IAM) user. For more information on the IAM service, see the AWS Identity and Access Management User Guide.

Before you run any commands, set your default credentials. For more information, see Configure the AWS CLI.

The following command uses create-login-profile to set an initial password on the specified user. When the user signs in for the first time, the user is required to change the password to something that only the user knows.

$ aws iam create-login-profile --user-name MyUser --password My!User1Login8P@ssword --password-reset-required { "LoginProfile": { "UserName": "MyUser", "CreateDate": "2018-12-14T17:27:18Z", "PasswordResetRequired": true } }

You can use the update-login-profile command to change the password for a user.

$ aws iam update-login-profile --user-name MyUser --password My!User1ADifferentP@ssword