为什么我无法使用 Fleet Manager 通过 RDP 连接到我的 Amazon EC2 Windows 实例?

2 分钟阅读
0

我无法使用 AWS Systems Manager Fleet Manager 通过远程桌面协议(RDP)连接到 Amazon Elastic Compute Cloud(Amazon EC2)Windows 实例。

简短描述

由于以下原因,您可能会在使用 RDP 时遇到连接问题:

  • AWS Identity and Access Management(IAM)用户或角色的权限不足
  • 连接请求超时
  • 用户名或密码不正确
  • 账户已禁用
  • 操作系统级别的默认 RDP 端口(3389)已更改
  • 本地或域账户密码已过期
  • 连接已终止
  • 连接在 60 分钟后断开
  • 目标未连接
  • 单点登录(SSO)登录错误

解决方法

确保满足以下先决条件:

  • 在使用远程桌面之前,请验证实例是否已满足环境要求
  • 确保 Systems Manager 控制台中已列出该实例。它必须在 Fleet Manager 部分的托管实例下方列出。此外,请确保 AWS Systems Manager Agent(SSM Agent)的 Ping 状态为在线

要对托管实例进行故障排除,请参阅为什么我的 EC2 实例在 Systems Manager 中未显示为托管节点或显示“连接丢失”状态?

权限不足

这表示您用于访问 Systems Manager 控制台的 IAM 用户或角色无权执行以下操作:

  • ssm-guiconnect:CancelConnection
  • ssm-guiconnect:GetConnection
  • ssm-guiconnect:StartConnection
An Error occurred while calling the StartConnection API operation. AccessDeniedException: User: arn:aws:iam::46xxxxxxxxxxx59:user/ssmtest
is not authorized to perform: ssm-guiconnect:StartConnection resource: arn:aws:ec2:us-west-2:46xxxxxxxxx59:instance/*'

要修复此问题,请配置所需权限。然后,重试该操作。

连接请求超时

如果 SSM Agent 运行在早期版本上,就会出现此错误:

An error occurred while establishing the Remote Desktop session. The remote desktop connection request Timed out.

要通过 Fleet Manager 使用远程桌面,请验证节点是否正在运行 SSM Agent 版本 3.0.222.0 或更高版本。要检查托管节点上安装的 SSM Agent 的版本号,请参阅检查 SSM Agent 版本号。要安装或更新 SSM Agent,请参阅使用 SSM Agent

用户名或密码不正确、账户已禁用或在操作系统级别更改了默认 RDP 端口

Fleet Manager 远程桌面窗口可能会卡住,并显示以下错误消息:

Its taking longer than expected to render the Remote Desktop connection. Please try again.
  • 您之所以会遇到此错误,可能是因为 IAM 用户使用了错误的用户名或密码。检查并确保输入正确的凭证。
  • 确认在 Active Directory、本地用户和群组管理中未禁用该用户账户。
  • 使用 PowerShell 命令确认 RDP 端口已设置为 3389。如果不是,请将其设置为默认值 3389。
PS> (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber").PortNumber
PS>  Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value 3389
PS>  Restart-Service TermService -force

本地或域账户密码已过期

本地用户或域用户的密码过期时,会出现以下错误:

An error occurred: Generic error

要解决此错误,请使用另一个账户通过 RDP 连接实例。使用 lusrmgr.msc 工具重置本地账户的密码。如果域账户的密码已过期,请联系域管理员或相应的系统管理员重置密码。

连接已终止

RDP 连接空闲超过 10 分钟后,系统会断开连接,此时会显示以下错误:

The connection has been terminated. The connection has been marked as idle.

之所以出现这种情况,是因为该活动远程桌面连接设置了如下条件:在空闲 10 分钟后断开连接。

只有在操作系统级别为现有活动 RDP 会话停止或重新启动远程桌面服务时,才会出现此错误:

The connection has been terminated. Generic Error.

连接在 60 分钟后断开

The connection has been Terminated. No Error

这不是错误。之所以发生这种情况,是因为该活动远程桌面连接设置了如下默认条件:远程桌面连接会在 60 分钟后断开。要防止连接被断开,请在连接断开之前选择续订会话。这将重置持续时间计时器。连接也可能因为如下原因而终止:在现有活动 RDP 会话中,Amazon EC2 实例关闭或重启。

目标未连接

当 EC2 Windows 实例未联机或刚刚进入启动状态时,就会出现以下错误:

An error occurred while calling the StartConnection API operation. ValidationException: The StartSession API operation didn't succceed: An error occurred (TargetNotConnected)

为防止出现此错误,请确保 EC2 实例在通过两次状态检查后处于正在运行状态。

SSO 登录错误

如果请求授权的地方未配置 SSO 或不支持 SSO,就会出现以下错误:

An error occurred while establishing the Remote Desktop Connection Error. The system cannot create an operating system for the SSO Login. The SSO functionality is not supported on the Domain controllers. You can only connect with username/password method.

要解决此错误,请使用用户名和密码连接到实例。您也可以联系贵公司的域管理员。

相关信息

AWS Systems Manager Fleet Manager

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