用 Java 将多台计算机连接到一个大脑

发布于 2024-09-03 04:34:06 字数 207 浏览 4 评论 0原文

我想知道哪些库或 API 对此有用。我的目标是能够在提示符中输入命令,然后指定在哪台计算机(在所有联网的计算机中)执行该命令。第二部分是我希望能够在指定的计算机上看到该命令的执行和结果。

例如,如果我输入“firefox www.google.com,desktop2”,我希望能够看到该计算机的显示器上打开的窗口。你明白我想做什么吗?任何帮助表示赞赏。

谢谢,莫菲斯

I was wondering which libraries or API's would be useful in this. what im aiming for is to be able to type a command into a prompt and then specify which computer(out of all of them that are networked together) to execute that command on. the second part is i want to be able to see that command execute and the result on the computer that was specified.

for example if i enter "firefox www.google.com, desktop2" i want to be able to see the window open on the monitor of that computer. Do you understand what im trying to do? any help is appreciated.

Thanks, Morpheous

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

瑾夏年华 2024-09-10 04:34:06

我想我会,但不知道为什么。例如,现有的机制可以做到这一点。如果您在每台“多台计算机”上运行 sshd,您可以简单地从“控制”运行:,

ssh -X user@desktop2 firefox www.google.com

然后您将使用远程 X 将 Firefox 转发回本地桌面(实际上是在桌面 2 上执行)。尝试 man ssh 了解更多信息,如果您想了解更多信息,请询问 serverfault。

如果你想开发一些东西来实现这种想法,那就是另一回事了,我会质疑 Java 是否是实现这一目标的最佳方法(意见各不相同,但它不是一种“系统语言”)。同样,现有的解决方案是存在的,例如用于 Fedora 等项目的构建系统(请参阅 Koji)。

我的建议是研究大量现有代码,只有当这不能解决您的问题或者您想要挑战时,才编写新的代码。

I think I do, but not why. For example, there are existing mechanisms for doing this. If you've got sshd running on each of your "multiple computers" you could simply, from "control", run:

ssh -X user@desktop2 firefox www.google.com

and you'd use remote X to forward firefox back to your local desktop (actually being executed on desktop2). Try man ssh for more information and ask on serverfault if you want to know more.

If you're looking to develop something that achieves this sort of idea, that's a different matter and I'd question if Java is the best way to do it (opinions vary but it's not a "systems language"). Again, existing solutions exist such as the build systems used for projects like Fedora (see Koji).

My advice would be to research a lot of existing code and only if this doesn't solve your problem or if you want a challenge, write something new.

为人所爱 2024-09-10 04:34:06

在 Windows 上,PSExec 将执行此操作:

命令行为

Usage: psexec [\\computer[,computer2[,...] | @file]
              [-u user [-p psswd]][-n s][-l][-s|-e][-x][-i [session]]
              [-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,... ] 
              cmd [arguments]

例如:

psexec \\computer2 -i firefox.exe www.google.com

将在远程计算机上以交互方式执行 firefox。


- PSExec、Microsoft PStools

On Windows, PSExec will do that:

The command line is

Usage: psexec [\\computer[,computer2[,...] | @file]
              [-u user [-p psswd]][-n s][-l][-s|-e][-x][-i [session]]
              [-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,... ] 
              cmd [arguments]

For example:

psexec \\computer2 -i firefox.exe www.google.com

Will execute firefox interactively on the remote computer.

See
- PSExec, Microsoft PStools

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