為 IAM 使用者設定初始密碼 - AWS Command Line Interface

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

為 IAM 使用者設定初始密碼

本主題說明如何使用 AWS Command Line Interface (AWS CLI) 命令來為 AWS Identity and Access Management (IAM) 使用者設定初始密碼。如需 IAM 服務的詳細資訊,請參閱《AWS Identity and Access Management 使用者指南》。

在執行任何命令前,請先設定您的預設憑證。如需更多詳細資訊,請參閱 配置 AWS CLI

以下命令使用 create-login-profile 來為指定的使用者設定初始密碼。當使用者首次登入時,使用者需要將密碼變更為只有該使用者知道的內容。

$ 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 } }

您可使用 update-login-profile 命令來變更使用者的密碼。

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