【问题标题】:how to transfer and execute a exe file on remote windows machine from ubuntu commandline?如何从 ubuntu 命令行在远程 Windows 机器上传输和执行 exe 文件?
【发布时间】:2018-01-11 08:25:00
【问题描述】:

我有一个 exe 文件,它会在我的远程 Windows 机器上安装一些东西。

我有一些 bash 脚本可以将此文件传输到远程 windows 机器并在远程 windows 机器上执行该 exe 文件。

这个 bash 脚本是通过一些自动化管道 jenkins 触发的。

有人可以帮我完成这个过程吗?

我尝试了什么:

我对 Windows 远程访问完全陌生。我已经使用 RDP 完成了一项并尝试了 winexe (https://www.aldeid.com/wiki/Winexe#Installation_of_winexe),但安装失败并出现错误:

make basics ~/bin/winexe Creating heimdal/lib/asn1/der-protos.h syntax error at heimdal/cf/make-proto.pl line 15, near "do Getopts(" Execution of heimdal/cf/make-proto.pl aborted due to compilation errors. data.mk:195: recipe for target 'heimdal/lib/asn1/der-protos.h' failed make: *** [heimdal/lib/asn1/der-protos.h] Error 255

【问题讨论】:

  • 流程的哪一部分需要帮助?你试过什么?
  • 请看编辑
  • 您看到的错误实际上是关于构建winexe,而不是关于您要完成的过程。

标签: windows bash remote-access rdp


【解决方案1】:

如果您有权访问远程 Windows 机器,您可以在那里安装 SFTP/SSH 服务器,参见 this 例如

有了它,你应该能够:

  1. 从你的 Ubuntu 命令行安全地复制文件

    scp <your_file> user@ip_win_server:<target location>
    
  2. 要么

    1. 通过 ssh 向 Windows 服务器发送命令

      ssh user@ip_win_server "your command"
      
    2. 使用 Winexe。

有用的参考:

https://zaiste.net/posts/a_few_ways_to_execute_commands_remotely_using_ssh/

How to execute a remote command over ssh with arguments?

https://unix.stackexchange.com/questions/171331/how-to-execute-windows-commands-remotely-from-linux-machine-using-rdesktop-comma

How to activate programs on windows from Linux machine

Copying a file remotely from Ubuntu to Windows 7

(旧的)https://serverfault.com/questions/10468/ssh-scp-server-on-windows

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-01-19
    • 1970-01-01
    • 2014-11-05
    • 1970-01-01
    • 2012-07-27
    • 1970-01-01
    • 2012-03-21
    • 2011-04-05
    相关资源
    最近更新 更多