在 Windows 上通过 OpenSSH 启动 GUI 程序? [英] Starting GUI programs via OpenSSH on Windows?

查看:95
本文介绍了在 Windows 上通过 OpenSSH 启动 GUI 程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试执行一个 labview VI,从另一台 Windows 机器上通过 ssh 调用的 .bat 文件启动它.所以我愿意

I'm trying to execute a labview VI, launching that from a .bat file, called via ssh, from another Windows machine. So I do

 ssh myuser@IP
 cd  Desktop
 launchVis.bat

我用用户和密码连接.myuser 拥有启动批处理文件的所有权限.同时我在同一台机器上通过 RDP 连接检查执行情况.

I connect with user and password. myuser have all the rights to launch the batch file. Meanwhile I check the execution via RDP connection on the same machine.

如果我从远程机器上的 cmd 行运行 bat 文件,则 VI 正常启动如果我从 ssh 连接运行 bat 文件,我可以在 bat 文件中看到 echo 的输出,但 LabVIEW 将在与 RDP-TCP#1 不同的会话中启动.结果是我可以看到一个名为Services的会话中启动了一个LabVIEW"进程,但是我看不到正在执行的VI,一般情况下,我不知道IF是否正在执行.

If I run the bat file from a cmd line on the remote machine, the VI starts normally If I run the bat file from the ssh connection, i can see the output of echoes in the bat file but LabVIEW will be launched in a different session from RDP-TCP#1. The result is that I can see a "LabVIEW" process started in a Session named Services, but I cannot see the VI executing and in general, I don't know IF is executing or not.

谷歌搜索这个问题,似乎我无法避免在服务"会话中启动进程,因此,我无法通过 SSH 启动任何 GUI 程序.建议的解决方案是使用 PsExec 或者,可能是 ssh 服务器的第三部分(使用第三方 ssh 服务器,我通过 Windows 7 达到了我的目标)

Googling about the problem, It seems that I cannot avoid to start processes in "Services" Session and, for this reason, I cannot launch any GUI Program via SSH. Suggested solutions are using PsExec or, maybe a third part of ssh Server (with a third part ssh Server I reached my goal over Windows 7)

推荐答案

使用第三方ssh服务器的解决方案"是这样的:
1) 卸载Windows10的可选功能OpenSSH Server"
2) 下载安装第三方ssh服务器.我使用了 freeSSHd
3) 请勿将此软件作为服务安装.
4) 在软件的设置中设置允许的用户.
5) 在shell::startup文件夹中放一个这个软件的exe链接,这样它就会在启动时运行.

The "solution", using a third part ssh server is this:
1) Uninstall the Optional Feature "OpenSSH Server" of Windows10
2) Download and install the third part ssh server. I used freeSSHd
3) DO NOT install this software AS AS SERVICE.
4) Set users allowed in the Settings of the software.
5) Put a link to the exe of this software in the shell::startup folder, so it will be run at startup.

这样,ssh 服务器将以用户身份启动并且可以执行 GUI 程序.

In that way, the ssh server will be launched as user and CAN execute GUI programs.

不幸的是,我没有达到与 Windows 官方 OpenSSH 服务器相同的目标,因为它无法以用户身份启动,但似乎只能作为服务运行

Unfortunately, I didn't reach to achieve the same goal with the Windows official OpenSSH server, because it fail to be launched as User, but seems working only as a Service

这篇关于在 Windows 上通过 OpenSSH 启动 GUI 程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆