Bootstrap FreeKB - Amazon Web Services (AWS) - Create IAM User Password using the AWS CLI
Amazon Web Services (AWS) - Create IAM User Password using the AWS CLI


This assumes you have already configured the aws command line tool. If not, check out my article on Getting Started with the AWS CLI.

The aws iam list-users command can be used to list your IAM user accounts.

~]$ aws iam list-users
{
    "Users": [
        {
            "Path": "/",
            "UserName": "john.doe",
            "UserId": "AIDAABCDL76GLUA6B21234",
            "Arn": "arn:aws:iam::711234074567:user/john.doe",
            "CreateDate": "2022-09-13T11:13:03+00:00"
        }
    ]
}

 

The aws iam create-login-profile can be used to set or reset a users password.

~]$ aws iam create-login-profile --user-name john.doe --password itsasecret
{
    "LoginProfile": {
        "UserName": "john.doe",
        "CreateDate": "2023-06-16T01:38:43+00:00",
        "PasswordResetRequired": false
    }
}

 

The --password-reset-required flag is often used to require the user to reset their password.

~]$ aws iam create-login-profile --user-name john.doe --password itsasecret --password-reset-required
{
    "LoginProfile": {
        "UserName": "john.doe",
        "CreateDate": "2023-06-16T01:38:43+00:00",
        "PasswordResetRequired": true
    }
}

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter d2e7f3 in the box below so that we can be sure you are a human.