通过 80 端口访问 Remoting 9


出于安全考虑,PowerShell Remoting 默认端口被设置为 5985,但这对于防火墙来说就太不友好啦!

原来我都是通过修改 Listener 的 Port 值,来把 5985 改成 80。

Set-Item WSMan:\localhost\Listener\Listener*\Port 80

网上发现还有更正式的方法启用 80 端口

Set-Item WSMan:\localhost\Service\EnableCompatibilityHttpListener true

修改完以后,会添加一个使用 80 端口的新 Listener。EnableCompatibilityHttpsListener 则表示启用 HTTPS。

开启防火墙中的“Windows 远程管理 – 兼容模式(HTTP-IN)”的入站项,你就可以通过 80 端口来远程访问啦!

New-PSSession -ConnectionURI http://yourserver

参考:New default ports for WS-Management and PowerShell remoting

本文链接: https://www.pstips.net/change-default-port-for-remoting.html
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!

回复 J 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注

9 条评论 “通过 80 端口访问 Remoting