简体   繁体   English

在远程服务器 (JSch) 上打开应用程序时显示交互式服务检测

[英]Interactive Services Detection showing when opening an application on remote server (JSch)

I have a SSH Server running and need to close and open a JavaFX application.我有一个 SSH 服务器正在运行,需要关闭和打开一个 JavaFX 应用程序。 Using freeSSHd and JSch, i was able to close the application using:使用 freeSSHd 和 JSch,我能够使用以下方法关闭应用程序:

sendCommand("wmic Path win32_process Where \"CommandLine Like '%Test.jar%'\" Call Terminate");

The command above closes the application without a problem.上面的命令可以毫无问题地关闭应用程序。

When I need to start the application again, I am trying to use:当我需要再次启动应用程序时,我尝试使用:

sendCommand("cmd /c cd C:/Test/dist && java -jar Test.jar");

What happens is that a window from Interactive Services Detection opens with the message : "A program running on this computer is trying to display a message".发生的情况是,来自 Interactive Services Detection 的窗口打开并显示消息:“此计算机上运行的程序正在尝试显示消息”。 Opening the message shows the JavaFX application.打开消息会显示 JavaFX 应用程序。

I need to open the JavaFX application directly on the remote computer, without this showing up.我需要直接在远程计算机上打开 JavaFX 应用程序,而不显示此内容。 Is this behavior normal?这种行为正常吗? Can i achieve this using SSH (JSch) ?我可以使用 SSH (JSch) 实现这一点吗? I know that PSExec is an alternative, but it has to be installed in every client computer.我知道 PSExec 是一种替代方法,但它必须安装在每台客户端计算机上。

The same happens when I try the command in PuTTY console.当我在 PuTTY 控制台中尝试命令时,也会发生同样的情况。

I think it is related to "Session 0 Isolation", but I don't know what this means.我认为这与“Session 0 Isolation”有关,但我不知道这是什么意思。

Normally the (SSH) servers run as a Windows service.通常,(SSH) 服务器作为 Windows 服务运行。

Window services run in a separate Windows session (google for "Session 0 isolation" ).窗口服务在单独的 Windows 会话中运行(谷歌搜索“会话 0 隔离” )。 They cannot access interactive (user) Windows sessions.他们无法访问交互式(用户)Windows 会话。

It's not that the "Interactive Services Detection" blocks the application.并不是“交互式服务检测”阻止了应用程序。 It's on the contrary.恰恰相反。 It's the "Interactive Services Detection" service that detects that a service is trying to show a GUI on an invisible Session 0 and allows you to replicate the GUI on the user session.它是“交互式服务检测”服务,它检测服务试图在不可见的会话 0 上显示 GUI,并允许您在用户会话上复制 GUI。

Also note that there can be multiple user sessions (multiple logged in users) in Windows.另请注意,Windows 中可以有多个用户会话(多个登录用户)。 How would the SSH server know, what user session to display the GUI on (even if it could)? SSH 服务器如何知道在哪个用户会话上显示 GUI(即使可以)? I guess (though it's just a speculation) that the "Interactive Services Detection" shows the prompt on all user sessions, and the first user, that accepts the prompt, wins the GUI.我猜(尽管这只是一个推测)“交互式服务检测”会在所有用户会话中显示提示,而第一个接受提示的用户将赢得 GUI。


You can run the SSH server in an interactive Windows session, instead as a service.您可以在交互式 Windows 会话中运行 SSH 服务器,而不是作为服务运行。 It has its limitations though.不过它也有它的局限性。 Actually FreeSSHD asks you, when installing, if you want to install it as a service or not.实际上,FreeSSHD 在安装时会询问您是否要将其安装为服务。

Though I do not recommend you using FreeSSHd at all.尽管我根本不建议您使用 FreeSSHd。 It's pretty buggy and not well maintained.它非常有缺陷,而且维护得不好。


In general, all this (running GUI application on Windows remotely through SSH) does not look like a good idea to me.一般来说,所有这些(通过 SSH 在 Windows 上远程运行 GUI 应用程序)对我来说都不是一个好主意。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM