上次更新时间:2021 年 4 月 20 日
当我尝试使用 AWS Systems Manager 会话管理器时,会话失败。如何排查会话管理器问题?
解决方法 排查会话管理器问题的具体步骤取决于会话失败的原因。如果会话由于以下任何原因而失败,请参阅排查会话管理器问题以了解问题排查的步骤:
无启动会话的权限 无更改会话首选项的权限 实例不可用或未配置为用于会话管理器 未找到会话管理器插件 会话管理器插件未自动添加到命令行路径 (Windows) 目标未连接 启动会话后显示空白屏幕 会话无法启动并显示错误消息 如果会话无法启动并显示以下任意一种错误消息,请参阅以下指南:“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 customer master key that does not exist, does not exist in this region, or you are not allowed to access. status code: 400, request id: xxxxxxxxxxxx”(由于以下原因,您的会话已终止:----------错误------- 启动握手时遇到错误。获取数据密钥失败:无法检索到数据密钥,解密数据密钥时出现访问被拒绝异常错误:密文指向不存在、在此区域不存在或不允许您访问的客户主密钥。状态码:400,请求 ID:xxxxxxxxxxxx)
您账户中的用户和实例不具有所需的 AWS Key Management Service (AWS KMS) 客户主密钥 (CMK) 权限。在为会话数据启用 AWS KMS 加密后,您必须授予使用密钥所需的权限。您可以使用 Identity and Access Management (IAM) 策略授予将 CMK 用于会话管理器的权限。
重要提示:您必须向启动会话的用户以及会话连接到的实例授予 CMK 权限。
要为您账户中的用户添加 CMK 权限,请参阅(快速入门)会话管理器的默认 IAM 策略。 要为账户中的实例添加 CMK 权限,请参阅验证或创建具有会话管理器权限的 IAM 实例配置文件。有关创建和管理 AWS KMS 密钥的更多信息,请参阅什么是 AWS Key Management Service?
“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”(由于以下原因,您的会话已终止:无法启动会话,因为我们无法验证 Amazon S3 存储桶上的加密。错误:访问被拒绝:访问被拒绝状态代码:403)
如果对于会话管理器首选项中的S3 Logging(S3 日志记录),您选择的是 Allow only encrypted S3 buckets(仅允许加密的 S3 存储桶),则会收到此错误。
要解决此错误,请选择以下任意一种问题排查步骤:
打开会话管理器首选项。对于 S3 Logging(S3 日志记录),清除Allow only encrypted S3 buckets(仅允许加密的 S3 存储桶)。有关更多信息,请参阅使用 Amazon S3 记录会话数据(控制台)。 向附加到实例的 IAM 实例配置文件添加一个策略,以授予将加密日志上传到 S3 的权限。有关说明,请参阅创建具有会话管理器、Amazon S3 和 CloudWatch Logs 权限的实例配置文件(控制台)。“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.”(由于以下原因,您的会话已终止:我们无法启动会话,因为选定的 CloudWatch Logs 日志组未设置加密。请加密该日志组或选择在不加密的情况下启用日志记录的选项。)
如果对于会话管理器首选项中的CloudWatch Logging(CloudWatch 日志记录),您选择的是 Allow only encrypted CloudWatch log groups(仅允许加密的 CloudWatch 日志组),则会收到此错误。
要解决此错误,请选择以下任意一种问题排查步骤:
打开会话管理器首选项。对于 CloudWatch Logging(CloudWatch 日志记录),清除 Allow only encrypted CloudWatch log groups(仅允许加密的 CloudWatch 日志组)。有关更多信息,请参阅使用 Amazon CloudWatch Logs 记录会话数据(控制台)。 向附加到实例的 IAM 实例配置文件添加一个策略,以授予将加密日志上传到 CloudWatch 的权限。有关说明,请参阅创建具有会话管理器、Amazon S3 和 CloudWatch Logs 权限的实例配置文件(控制台)。