

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

# 重設 Chef Automate 儀表板登入資料
<a name="opscm-resetchefcreds"></a>

**重要**  
AWS OpsWorks for Chef Automate 已於 2024 年 5 月 5 日結束生命週期，並已針對新客戶和現有客戶停用。我們建議現有客戶遷移至 Chef SaaS 或替代解決方案。如果您有任何問題，可以在 [AWS re：Post](https://repost.aws/) 或透過 [AWS Premium Support](https://aws.amazon.com/support) 聯絡 AWS 支援 團隊。

有時候，您可能會希望變更您用來登入 Chef Automate 儀表板的密碼。您也可以使用本節中顯示的 Amazon EC2 Systems Manager AWS CLI 命令，在遺失時變更 Chef Automate 儀表板密碼。您使用的命令取決於您的 Chef Automate 伺服器是否執行 Chef Automate 第 1 版或第 2 版。

1. 若要傳回 Chef 伺服器的執行個體 ID，請開啟 AWS 管理主控台 至下頁。

   https://console.aws.amazon.com/ec2/v2/home?region=*region\$1of\$1your\$1server*\$1Instances:search=aws-opsworks-cm-*server\$1name*

   例如，對於美國西部 （奧勒岡） 區域中名為 **MyChefServer** 的 Chef 伺服器，主控台 URL 如下。

   https://console.aws.amazon.com/ec2/v2/home?region=us-west-2\$1Instances:search=aws-opsworks-cm-MyChefServer

   記下主控台中顯示的執行個體 ID，您將會在變更密碼時用到。

1. 若要重設 Chef Automate 儀表板登入密碼，請執行下列其中一個 AWS CLI 命令，取決於您的伺服器是執行 Chef Automate 1 還是 Chef Automate 2。以您的企業或組織名稱取代 *enterprise\$1name*、以伺服器上管理員的使用者名稱取代 *user\$1name*、以您要使用的密碼取代 *new\$1password*，以及以伺服器所在的區域取代*region\$1name*。若您沒有指定企業名稱，則企業名稱將為 `default`。根據預設，*enterprise\$1name* 為 `default` (此為一律會用來佈建之組織的名稱)。對於 *user\$1name*， AWS OpsWorks for Chef Automate 僅建立名為 的使用者`admin`。記下新的密碼，然後將其存放在安全但便利的位置。

   對於 Chef Automate 1：

   ```
   aws ssm send-command --document-name "AWS-RunShellScript" --comment "reset admin password" --instance-ids "instance_id" 
   --parameters commands="sudo delivery-ctl reset-password enterprise_name user_name new_password" --region region_name --output text
   ```

   對於 Chef Automate 2：

   ```
   aws ssm send-command --document-name "AWS-RunShellScript" --comment "reset admin password" --instance-ids "instance_id" 
   --parameters commands="sudo chef-automate iam admin-access restore new_password" --region region_name --output text
   ```

1. 等待輸出文字 (在此案例中為命令 ID) 以顯示密碼變更已完成。