在 python 中有没有办法将 RDP 转换为 windows ec2 实例?
Is there a way in python to RDP into a windows ec2 instance?
就像我们有 python 库 BOTO3,我们可以使用它来 ssh 到基于 linux 的 ec2 实例,但看起来相同的脚本不适用于基于 windows 的EC2实例。我在这个问题中使用 python 脚本连接到我的 windows 。但我收到以下错误:
[WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
我的所有安全组规则都符合要求,我在传入选项卡中打开了 RDP 端口。仍然收到此错误。
在 python 中有没有办法将 RDP 转换为 windows ec2 实例?或者与此相关的任何其他编程语言?
总结一下我们在评论中讨论的内容。
您的目标是从 EC2 windows 实例针对数据库 运行 SQL 脚本,并且您希望通过 Python.
触发此操作
你建议的使用 RDP 的解决方案是有问题的,因为与 SSH 相比,RDP 是一个 GUI 驱动的协议,它基本上会向你发送像素的颜色值,这很难与之交互。等同于 SSH 连接的是或多或少的 PowerShell Remoting,它需要您打开一个端口,可以从您的 python 脚本访问。
不需要使服务器可从外部访问的解决方案是使用 Systems Manager 自动化。您可以创建一个自动化文档到 运行 a PowerShell script on the instance for example and trigger that via the API (ssm:StartAutomationExecution).
就像我们有 python 库 BOTO3,我们可以使用它来 ssh 到基于 linux 的 ec2 实例,但看起来相同的脚本不适用于基于 windows 的EC2实例。我在这个问题中使用 python 脚本连接到我的 windows
[WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
我的所有安全组规则都符合要求,我在传入选项卡中打开了 RDP 端口。仍然收到此错误。 在 python 中有没有办法将 RDP 转换为 windows ec2 实例?或者与此相关的任何其他编程语言?
总结一下我们在评论中讨论的内容。
您的目标是从 EC2 windows 实例针对数据库 运行 SQL 脚本,并且您希望通过 Python.
触发此操作你建议的使用 RDP 的解决方案是有问题的,因为与 SSH 相比,RDP 是一个 GUI 驱动的协议,它基本上会向你发送像素的颜色值,这很难与之交互。等同于 SSH 连接的是或多或少的 PowerShell Remoting,它需要您打开一个端口,可以从您的 python 脚本访问。
不需要使服务器可从外部访问的解决方案是使用 Systems Manager 自动化。您可以创建一个自动化文档到 运行 a PowerShell script on the instance for example and trigger that via the API (ssm:StartAutomationExecution).