为 IAM 用户设置初始密码 - Amazon Command Line Interface
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文档仅适用于 Amazon CLI 版本 1。有关 Amazon CLI 版本 2 的相关文档,请参阅版本 2 用户指南

为 IAM 用户设置初始密码

本主题介绍如何使用 Amazon Command Line Interface (Amazon CLI) 命令为 Amazon Identity and Access Management (IAM) 用户设置初始密码。有关 IAM 服务的更多信息,请参阅 Amazon Identity and Access Management 用户指南

在运行任何命令之前,请设置默认证书。有关更多信息,请参阅配置Amazon 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