作为另一个域的另一个用户进行.NET 远程调试?

发布于 2024-12-11 18:40:00 字数 158 浏览 0 评论 0原文

我正在尝试通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

对你的占有欲 2024-12-18 18:40:00

与此斗争了很长时间。

检查

  1. 两台计算机是否位于同一域中,或者 VS 远程调试器和客户端 VS 都以具有相同密码的同一用户身份运行。您的用户可以位于不同的域或工作组中,但登录名必须相同
  2. 需要机器之间双向无限制的直接连接。

Been fighting with this for a long time.

Check that

  1. Both computers are in the same domain OR both VS remote debugger and client VS are running as a same user with identical password. Your users can be in different domains or workgroups but login name must be identical
  2. Unrestricted direct connection between machines in both direction is required.
爱的那么颓废 2024-12-18 18:40:00

根据我的经验,远程调试设置起来很痛苦!我是这样做的(类似于您已经收到的回复):

  1. 在远程框中,创建一个本地管理员用户,其用户名和密码与您的域帐户相同。确保该本地用户是调试组的一部分。
  2. 在本地机器上,共享 VS 中的远程调试文件夹 (...\common7\ide\remote debugger)
  3. 在远程机器上,在本地机器上创建的共享中创建 msvsmon.exe 文件的快捷方式。
  4. 在远程盒子上,运行快捷方式以便远程调试器启动。这可以保证您运行正确的远程调试版本。
  5. 从 Visual Studio 尝试使用 User@machine_name 连接到远程计算机,其中 User 是远程机器上登录用户的用户名(不是您创建的本地管理员帐户)。
  6. 您应该看到远程调试器注册了连接。

如果这不起作用,您可能会遇到进一步的网络或权限问题。

希望有帮助!

In my experience remote debug is a pain to set up! Here's how I do it (similar to replies you've already had):

  1. On the remote box, create a local admin user with the same username and password as your domain account. Make sure this local user is part of the debugging group.
  2. On your local box, share the remote debug folder in VS (...\common7\ide\remote debugger)
  3. On the remote box, create a shortcut to the msvsmon.exe file in the share created on your local box.
  4. On the remote box, run the shortcut so remote debugger starts. This guarantees you are running the correct remote debug version.
  5. From visual studio try connecting to the remote machine with User@machine_name, where User is the username of the logged in user on the remote box (not the local admin account you created).
  6. You should see the remote debugger register the connection.

If this doesn't work you may have further networking or permissions problems.

Hope that helps!

生来就爱笑 2024-12-18 18:40:00

我已经多次以另一个用户的身份在跨域的远程计算机上调试进程。

首先,您需要学习如何调试同一域中的远程进程。
@KyleMit 的答案完全帮助我做到了这一点。

但是,对于跨域调试,您还需要编辑本地计算机上的 C:\Windows\System32\drivers\etc\hosts 文件。

只需添加远程计算机的 IP 地址,如下所示:

172.172.172.172     SRV-TEST-ADRESS

其中:

  • 172.172.172.172 - 远程服务器的 IP 地址
  • SRV-TEST-ADRESS - Visual Studio 远程调试器中的服务器名称
    远程计算机监控

您可以通过cmd中的ipconfig了解您服务器的IP地址

Visual Studio 远程调试器监视器

如果您需要有关跨域调试的更多详细说明,请检查这个链接

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:

172.172.172.172     SRV-TEST-ADRESS

Where:

  • 172.172.172.172 - ip address of your remote server
  • SRV-TEST-ADRESS - Server's name from Visual Studio Remote Debugger
    Monitor on remote computer

You can know your server's ip address by ipconfig in cmd

Visual Studio Remote Debugger Monitor

If you need more details explanation about across domain debugging, check this link.

仄言 2024-12-18 18:40:00

这是一个盲目的尝试……假设您有 VPN 访问权限。我仍然不确定它是否有效。也许值得一试

  1. Connect VPN
  2. 将域帐户添加为远程机器上的本地用户
  3. 看看是否可以右键单击以该帐户身份运行。

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

  1. Connect VPN
  2. Add the domain account as a local user on your remote box
  3. See if you can right click run as that account.
情归归情 2024-12-18 18:40:00

在远程计算机上运行远程调试器监视器后,配置调试权限以允许每个人访问。当您从 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.

不必你懂 2024-12-18 18:40:00

我发现当双方都有本地帐户、拼写相同且密码相同时,它会起作用。不够持续,我不会依赖它。

您尝试过使用 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.

贱贱哒 2024-12-18 18:40:00

我还有更多事情要尝试,因为我最终使远程调试能够工作,但这很棘手:

  • 请注意运行 Visual Studio 的用户,默认情况下我以管理员身份运行它,我必须以本地域用户身份运行才能连接
  • 在此阶段,我还无法连接到其他域,但作为中间步骤,我输入了域上服务器的限定符,并且能够看到这些进程。
  • 现在,我将限定符更改为另一个域的 IP 地址域名(不需要输入4020 端口号)并点击“刷新”按钮,你瞧,系统提示我输入另一个域上帐户的凭据。
  • 这有效,我能够看到要连接的进程,
  • 如果没有,我无法获得登录屏幕输入我的域中的服务器的先前步骤

I have a couple more things to try as I eventually got remote debugging to work but it was tricky:

  • Be aware of the user that is running Visual Studio, by default I run it as Administrator, I had to run as my local domain user to connect
  • At this stage I was able not able to connect to the other domain yet but as an intermediate step I entered the Qualifier of a server on my domain and was able to see those processes
  • Now I changed the Qualifier to the IP Address of the other domain (didn't need to enter 4020 port number) and hit the Refresh button and lo and behold I was prompted to enter the credentials of an account on the other domain
  • This worked and I was able to see the processes to connect to
  • I was not able to get the login screen without the prior step of entering a server on my domain
你另情深 2024-12-18 18:40:00

我在这里尝试了与 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文