【问题标题】:Lost remote access to azure vm失去对 azure vm 的远程访问
【发布时间】:2016-09-09 19:11:04
【问题描述】:

我更改了 Azure VM 上的 RDP 端口。现在我无法连接到它。可能是因为我忘记设置防火墙以允许新端口。现在我无法访问它。

我不确定我之前是否在该 VM 上设置过 Powershell。但是,当我使用 Enter-PSSession 时,它给了我这个错误:

Enter-PSSession : Connecting to remote server 40.xx.xxx.xxx failed with the following error message : WinRM cannot
complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the
network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By
default, the WinRM firewall exception for public profiles limits access to remote computers within the same local
subnet. For more information, see the about_Remote_Troubleshooting Help topic.

【问题讨论】:

  • 您是否尝试将端口更改回来?如果不能:您是否更改了端点(或网络安全组的入站端口映射)以映射到您的新端口?在任何情况下:这应该在 ServerFault 上,而不是 StackOverflow(它与编程无关)。
  • 谢谢。问题是如何在没有 RDP 的情况下更改端口。我在门户中找到了一个可以上传脚本的工具,它完成了这项工作。

标签: azure azure-virtual-machine rdp


【解决方案1】:

您需要将虚拟机的 IP 地址添加到受信任的主机(在您连接的盒子上。 Set-Item WSMan:\localhost\Client\TrustedHosts -Value "40.xx.xxx.xxx" (or *)

【讨论】:

    【解决方案2】:

    如果您确定此问题是由操作系统的本地防火墙引起的。然后您可以通过自定义脚本扩展更改防火墙规则。

    如果您使用的是 ASM 模式,请查看此article

    如果您使用的是ARM模式,请查看article

    您可以通过 powershell 命令 New-NetFirewallRule 创建新的防火墙规则。

    有关如何通过powershell管理windows防火墙的详细信息,请参考以下链接:

    Network Security Cmdlets in Windows PowerShell

    【讨论】:

      【解决方案3】:

      我找到了自己的答案。在 azure 端口中,有一种方法可以上传 powerscript 文件以在 VM 中运行。我只是用它把端口改回旧的 3389 并重新启动。

      【讨论】:

        猜你喜欢
        • 2020-12-06
        • 2018-10-31
        • 2020-11-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-11-21
        • 2021-09-17
        • 1970-01-01
        相关资源
        最近更新 更多