简体   繁体   English

Google Cloud Windows VM RDP(TCP)端口更改不起作用

[英]Google Cloud Windows VM RDP(tcp) port change not working

In the Google cloud platform, I have windows VM to which I want to make a remote desktop connection, it works if I connect with the default port when a VM is created, but if I change a port to something else (like I tried 3300, 3388) from either cloud console or even from regedit and restarted the instance, RDP stopped working. 在Google云平台中,我有要与之建立远程桌面连接的Windows VM,如果在创建VM时使用默认端口进行连接,但是如果我将端口更改为其他端口(例如尝试3300),则可以正常工作(3388),或者从regedit甚至从regedit重启实例,RDP都停止工作。 Any idea? 任何想法?

Did you add the new port to the Firewall rules? 您是否将新端口添加到防火墙规则中? Incoming ports are blocked by default, if you want to use a new port you have to add it to the rule below VPC-Networking 默认情况下,传入端口是阻止的,如果要使用新端口,则必须将其添加到VPC-Networking下面的规则中

In addition to the GCP firewall rule , you would have to open the port from the instance (Windows firewall). 除了GCP 防火墙规则外 ,您还必须从实例(Windows防火墙)打开端口。 I assume you can not access the instance anymore. 我假设您无法再访问该实例。 As such, you can use a startup script by editing the instance and add a metadata key and value. 这样,您可以通过编辑实例并添加元数据键和值来使用启动脚本。

Similar to this Microsoft blog example , you may use this key “windows-startup-script-ps1” with this Powershell script value 类似于此Microsoft博客示例 ,您可以将此键“ windows-startup-script-ps1”与此Powershell脚本值一起使用

netsh advfirewall firewall add rule name="Open Port  3300" dir=in action=allow protocol=TCP localport= 3300

Then, reboot (reset instance). 然后,重新启动(重置实例)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM