如何對 AWS Systems Manager Session Manager 的問題進行疑難排解?

2 分的閱讀內容
0

當我嘗試使用 AWS Systems Manager Session Manager 時,我的工作階段失敗。

解決方法

Session Manager 問題疑難排解的步驟會根據工作階段失敗的原因而有所不同。

當 Amazon Elastic Compute Cloud (Amazon EC2) 執行個體無法作為受管理執行個體而導致工作階段失敗時,請對受管理執行個體可用性進行疑難排解

當工作階段失敗且您的 EC2 執行個體作為受管理執行個體可用時,請對 Session Manager 進行疑難排解以解決下列問題:

  • Session Manager 沒有啟動工作階段的權限。
  • Session Manager 沒有變更工作階段偏好設定的權限。
  • 受管理節點不可用於或未設定用於 Session Manager。
  • Session Manager 外掛程式未新增至命令行路徑 (Windows)。
  • 系統會傳送 TargetNotConnected 錯誤。
  • Session Manager 在您啟動工作階段時顯示空白畫面。

當工作階段失敗並顯示下列其中一個錯誤訊息時,請套用適當的疑難排解指南。

"Your session has been terminated for the following reasons: ----------ERROR------- Encountered error while initiating handshake.Fetching data key failed: Unable to retrieve data key, Error when decrypting data key AccessDeniedException: The ciphertext refers to a AWS KMS key that does not exist, does not exist in this region, or you are not allowed to access. status code: 400, request id: xxxxxxxxxxxx"

當您帳戶中的使用者和 EC2 執行個體沒有必要的 AWS Key Management Service (KMS) 金鑰權限時,您會收到此錯誤。若要解決此錯誤,請為您的工作階段資料開啟 AWS KMS 加密,然後依照下列步驟執行:

1.    將所需的 KMS 金鑰權限授予啟動工作階段的使用者以及工作階段連線的執行個體。然後,設定 AWS Identity and Access Management (IAM),為使用者和執行個體提供對 Session Manager 使用 KMS 金鑰的權限:

**注意:**從 AWS Systems Manager Agent (SSM Agent) 3.2.582.0 版開始,預設主機管理組態會自動管理不含 IAM 執行個體設定檔的 EC2 執行個體。執行個體必須使用 Instance Metadata Service 版本 2 (IMDSv2)。

"Your session has been terminated for the following reasons: Couldn't start the session because we are unable to validate encryption on Amazon S3 bucket.Error: AccessDenied: Access Denied status code: 403"

在 Session Manager 偏好設定中為 S3 記錄選擇僅允許加密的 S3 儲存貯體時,您會收到此錯誤。請遵循下列其中一個程序來解決錯誤:

"Your session has been terminated for the following reasons: We couldn't start the session because encryption is not set up on the selected CloudWatch Logs log group.Either encrypt the log group or choose an option to enable logging without encryption."

在 Session Manager 偏好設定中為 CloudWatch 記錄選擇僅允許加密的 CloudWatch 日誌群組時,您會收到此錯誤。請遵循下列其中一個程序來解決錯誤:

相關資訊

如何在 Amazon EC2 執行個體上連接或取代執行個體設定檔?

記錄工作階段活動

設定 Session Manager

AWS 官方
AWS 官方已更新 1 年前