作为另一个域的另一个用户进行.NET 远程调试?
我正在尝试通过 Visual Studio 2010 进行远程调试。但我无法告诉调试器使用远程计算机上的另一个(远程)帐户。 (不要使用我的帐户。)
有任何提示吗?
更新:我的计算机上没有远程帐户(它位于另一个域中)。所以我不能使用runas
。
I am trying to debug remotely via Visual Studio 2010. But I am unable to tell the debugger to use another (remote) account on the remote machine. (Not to use my account.)
Any hints?
UPDATE: I don't have the remote account on my computer (it is in another domain). So I cannot use runas
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
与此斗争了很长时间。
检查
Been fighting with this for a long time.
Check that
根据我的经验,远程调试设置起来很痛苦!我是这样做的(类似于您已经收到的回复):
如果这不起作用,您可能会遇到进一步的网络或权限问题。
希望有帮助!
In my experience remote debug is a pain to set up! Here's how I do it (similar to replies you've already had):
If this doesn't work you may have further networking or permissions problems.
Hope that helps!
我已经多次以另一个用户的身份在跨域的远程计算机上调试进程。
首先,您需要学习如何调试同一域中的远程进程。
@KyleMit 的答案完全帮助我做到了这一点。
但是,对于跨域调试,您还需要编辑本地计算机上的
C:\Windows\System32\drivers\etc\hosts
文件。只需添加远程计算机的 IP 地址,如下所示:
其中:
172.172.172.172
- 远程服务器的 IP 地址SRV-TEST-ADRESS
- Visual Studio 远程调试器中的服务器名称远程计算机监控
您可以通过
cmd
中的ipconfig
了解您服务器的IP地址如果您需要有关跨域调试的更多详细说明,请检查这个链接。
I've debugged process on remote computer across domain as another user several times.
First, you need to learn how to debug remote process in the same domain.
@KyleMit's answers completely helped me do that.
But, for across domain debugging also you need to edit
C:\Windows\System32\drivers\etc\hosts
file on local computer.Just add remote computer's ip address like this:
Where:
172.172.172.172
- ip address of your remote serverSRV-TEST-ADRESS
- Server's name from Visual Studio Remote DebuggerMonitor on remote computer
You can know your server's ip address by
ipconfig
incmd
If you need more details explanation about across domain debugging, check this link.
这是一个盲目的尝试……假设您有 VPN 访问权限。我仍然不确定它是否有效。也许值得一试
Here's a shot in the dark... with the big assumption you have VPN access. And I'm still not sure it would work. Maybe worth a try though
在远程计算机上运行远程调试器监视器后,配置调试权限以允许每个人访问。当您从 Visual Studio 连接到远程计算机时,请使用以下格式作为限定符:
remote_domain\remote_user@remote_machine
远程用户是远程调试器在其下运行的用户。
请记住远程计算机上的防火墙。
After running remote debugger monitor on remote machine, configure debugging permissions to allow access for everyone. When you connect to the remote machine from your Visual Studio use this format for Qualifier:
remote_domain\remote_user@remote_machine
Remote user is the one under which remote debugger runs.
Remember about firewall on the remote machine.
我发现当双方都有本地帐户、拼写相同且密码相同时,它会起作用。不够持续,我不会依赖它。
您尝试过使用 Windbg 来代替吗?刚开始使用时有点痛苦,但它可以完成工作。
I've seen it work when you have local accounts on both sides, spelled identically and with the same password. Not consistently enough that I'd rely on it.
Have you tried using windbg instead? It's a bit painful to use at first, but it gets the job done.
我还有更多事情要尝试,因为我最终使远程调试能够工作,但这很棘手:
I have a couple more things to try as I eventually got remote debugging to work but it was tricky:
我在这里尝试了与 Visual Studio 相关的答案,但没有成功(VS 2022)。
然后我尝试了 Jetbrains 远程调试器,它非常简单...
在远程计算机上,我只需执行此脚本,该脚本将 IP、端口和凭据写入输出,然后将这些凭据输入 Rider 远程 SSH 连接。它刚刚起作用了。
我正在使用 .NET core 6 + Windows Server 2019(远程)
https://www.jetbrains.com/help/rider/SSH_Remote_Debugging.html#set-up-ssh-server-on-the-remote-machine
I tried those answers related to Visual Studio here with no luck (VS 2022).
Then I tried Jetbrains remote debugger it was so easy...
On the remote machine I just execute this script which wrote IP, port and credentials to the output and then I enter those credentials into Rider Remote SSH connection. It just worked.
I am using .NET core 6 + Windows Server 2019 (on remote)
https://www.jetbrains.com/help/rider/SSH_Remote_Debugging.html#set-up-ssh-server-on-the-remote-machine