

Amazon Tools for PowerShell V4 已进入维护模式。

我们建议您迁移到 [Amazon Tools for PowerShell V5](https://docs.amazonaws.cn/powershell/v5/userguide/)。有关如何迁移的更多详细信息和信息，请参阅我们的[维护模式公告](https://www.amazonaws.cn/blogs/developer/aws-tools-for-powershell-v4-maintenance-mode-announcement/)。

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用旧版凭证
<a name="pstools-cred-legacy"></a>

本部分中的主题提供有关在不使用 Amazon IAM Identity Center的情况下使用长期或短期凭证的信息。

**警告**  
为了避免安全风险，在开发专用软件或处理真实数据时，请勿使用 IAM 用户进行身份验证，而是使用与身份提供者的联合身份验证，例如 [Amazon IAM Identity Center](https://docs.amazonaws.cn/singlesignon/latest/userguide/what-is.html)。

**注意**  
这些主题中的信息适用于需要手动获取和管理短期或长期凭证的情况。有关短期和长期凭证的更多信息，请参阅*Amazon SDKs 和工具参考指南*中的[其他身份验证方式](https://docs.amazonaws.cn/sdkref/latest/guide/access-users.html)。  
要了解最佳安全实践，请使用 Amazon IAM Identity Center，如中所述[配置工具身份验证](creds-idc.md)。

## 有关凭证的重要警告和指南
<a name="pstools-creds-warnings-and-guidelines"></a>

**有关凭证的警告**
+ ***请勿***使用您账户的根凭证访问 Amazon 资源。这些凭证可提供不受限的账户访问且难以撤销。
+ ***请勿***在命令或脚本中按字面输入访问密钥或凭证信息。否则，会产生意外泄露凭证的风险。
+ 请注意，存储在共享 Amazon `credentials`文件中的任何凭据都以纯文本形式存储。

**有关安全管理凭证的更多指南**

有关如何安全管理 Amazon 证书的一般性讨论，请参阅 IAM 用户指南中的[Amazon 安全证书[Amazon Web Services 一般参考](https://docs.amazonaws.cn/general/latest/gr/)](https://docs.amazonaws.cn/general/latest/gr/Welcome.html#aws-security-credentials)和《[IAM 用户指南](https://docs.amazonaws.cn/IAM/latest/UserGuide/)》中的[安全最佳实践和用例](https://docs.amazonaws.cn/IAM/latest/UserGuide/IAMBestPracticesAndUseCases.html)。除了上述讨论内容外，请考虑以下事项：
+ 创建其他用户，例如 IAM Identity Center 中的用户，并使用这些用户的凭证，而不是使用您的 Amazon 根用户凭证。如有必要，可以撤销其他用户的凭证，或者这些凭证本来就是临时的。此外，您可以对每个用户应用仅允许访问某些资源和操作的策略，从而采取最低权限的立场。
+ 对于 Amazon Elastic Container Service (Amazon ECS)，使用[适用于任务的 IAM 角色](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task-iam-roles.html)。
+ 对于在 Amazon EC2 实例上运行的应用程序，使用 [IAM 角色](shared-credentials-in-aws-powershell.md#shared-credentials-assume-role)。

**Topics**
+ [重要警告和指南](#pstools-creds-warnings-and-guidelines)
+ [Amazon 凭证](specifying-your-aws-credentials.md)
+ [共享凭证](shared-credentials-in-aws-powershell.md)