

AWS Tools for PowerShell V4 已進入維護模式。

我們建議您遷移至 [AWS Tools for PowerShell V5](https://docs.aws.amazon.com/powershell/v5/userguide/)。如需如何遷移的其他詳細資訊和資訊，請參閱我們的[維護模式公告](https://aws.amazon.com/blogs/developer/aws-tools-for-powershell-v4-maintenance-mode-announcement/)。

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

# 使用舊版憑證
<a name="pstools-cred-legacy"></a>

本節中的主題提供有關在不使用 AWS IAM Identity Center的情況下使用長期或短期憑證資訊。

**警告**  
為避免安全風險，在開發專用軟體或使用真實資料時，請勿使用 IAM 使用者進行身分驗證。相反地，搭配使用聯合功能和身分提供者，例如 [AWS IAM Identity Center](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html)。

**注意**  
這些主題中的資訊適用於您需要手動取得及管理短期或長期憑證的情況。有關短期和長期憑證的其他資訊，請參閱 *AWS SDK 和工具參考指南*中的[其他驗證方法](https://docs.aws.amazon.com/sdkref/latest/guide/access-users.html)。  
如需最佳實務，請使用 AWS IAM Identity Center，如 中所述[設定工具身分驗證](creds-idc.md)。

## 憑證的重要警告和指引
<a name="pstools-creds-warnings-and-guidelines"></a>

**憑證警告**
+ ***請勿使用***您帳戶的根登入資料來存取 AWS 資源。這些登入資料可讓未管制的帳戶存取和很難撤銷這些帳戶。
+ ***請勿***在命令或指令碼中放置常值存取金鑰或憑證資訊。如果這樣做，則會造成意外暴露您的憑證的風險。
+ 請注意，存放在共用 AWS `credentials`檔案中的任何登入資料都會以純文字儲存。

**安全管理憑證的其他指引**

如需如何安全管理 AWS 登入資料的一般討論，請參閱《》中的[AWS 安全登入](https://docs.aws.amazon.com/general/latest/gr/Welcome.html#aws-security-credentials)資料[AWS 一般參考](https://docs.aws.amazon.com/general/latest/gr/)和《[IAM 使用者指南](https://docs.aws.amazon.com/IAM/latest/UserGuide/)》中的[安全最佳實務和使用案例](https://docs.aws.amazon.com/IAM/latest/UserGuide/IAMBestPracticesAndUseCases.html)。除了這些討論之外，請考慮下列事項：
+ 建立其他使用者 (例如 IAM Identity Center 中的使用者)，並使用其憑證，而不是使用您的 AWS 根使用者憑證。如有必要，其他使用者的憑證可以被撤銷，或本質上是臨時的。此外，您可以將政策套用至每個使用者，以便僅存取特定資源和動作，從而採取最低權限許可的立場。
+ 使用適用於 Amazon Elastic Container Service (Amazon ECS) 任務的[任務 IAM 角色](https://docs.aws.amazon.com/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)
+ [AWS 登入資料](specifying-your-aws-credentials.md)
+ [共用憑證](shared-credentials-in-aws-powershell.md)