Setting an initial password for an IAM user - Amazon Command Line Interface
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Setting an initial password for an IAM user

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

Before you run any commands, set your default credentials. For more information, see Configuring the Amazon 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 an IAM user.

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