Visual Studio 2017和远程调试器Msvsmon之间的ssh隧道

问题描述 投票:0回答:1

我想从在machine1上运行的Visual Studio 2017调试在machine2上运行的应用程序。我只能通过ssh连接到machine2。从machine1到machine2的ssh连接工作正常。

[在machine2上,我运行Visual Studio 2017远程调试器,端口号4022,“无身份验证”和“允许任何用户调试”。

端口号可能是4023,因为machine2是运行32位应用程序的64位窗口:https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugger-port-assignments?view=vs-2017但是我不确定,因为我不知道如何检查远程调试器是32还是64。

我通过在machine1上运行此命令来创建ssh隧道:

ssh -L 4022:localhost:4022 machine2user @ machine2IP

((如何创建多个隧道?隧道是否双向?)

在machine1 Visual Studio项目设置上,我将远程调试器设置为“远程(无身份验证),并将目标设置为localhost:4022。

settings

我可以看到在machine2远程调试器中,machine1用户已连接。在machine1 visual studio中,我可以看到在machine2上运行的进程。

但是当我尝试附加到我的exe进程时,我得到:

error message

machine1上的防火墙规则允许任何ssh通信和4022,4023通信。机器2上的防火墙规则是由远程调试器安装自动设置的。

如何使Machine1上的Visual Studio侦听来自machine2的远程调试器流量? (我猜可能是问题所在)。

我已经在这里检查了类似的问题,没有帮助。

ssh visual-studio-2017 remote-debugging portforwarding ssh-tunnel
1个回答
0
投票

我通过创建具有端口4023的隧道来解决它:

ssh -L 4023:localhost:4023 machine2user @ machine2IP

© www.soinside.com 2019 - 2024. All rights reserved.