Change the password of an IAM user by running the below command where username is the name of the user and userpassword is the password.
aws iam update-login-profile --user-name username --password userpassword
If an IAM user does not have a password, you can create it using the below command – where username is the name of the user and userpassword is the password. If you specify –password-reset-required, the user will be prompted to change their password at the first login.
ws iam create-login-profile --username username --password userpassword --password-reset-required