in reply to Re: Perl with Net::SSH2, vshell and psexec
in thread Perl with Net::SSH2, vshell and psexec

Thanks for the reply..

I have used net::openssh on another variant of these scripts.. Again no such luck. Currently I have 15 variants using: Net::SSH::Expect, Net::SSH2, Net::SSH::Perl, Net::OpenSSH. Thinking one of these would work.

I still get a "Caption" output like the one stated in the original post using Net::OpenSSH. It seems somehow when the process is forked the SSH client (perl) loses this channel/output.

  • Comment on Re^2: Perl with Net::SSH2, vshell and psexec

Replies are listed 'Best First'.
Re^3: Perl with Net::SSH2, vshell and psexec
by salva (Canon) on Feb 10, 2014 at 15:15 UTC
    What do you get when you run the command through ssh without a tty?
    ssh $WINDOWS_HOST 'c:\psexec.exe /accepteula c:\psexec.exe /accepteula + \\localhost wmic OS get Caption'

    psexec may be expecting a GUI environment, event if it doesn't seem to use it.

    The issue may also be related to quoting. Windows SSH servers use different approaches to launch commands. Some run them through cmd.exe, others just call the function CreateProcess from the Win32 API, etc.

      Salva,

      Thanks for the response..

      Here's the output:

      PsExec v1.98 - Execute processes remotely Copyright (C) 2001-2010 Mark Russinovich Sysinternals - www.sysinternals.com c:\psexec.exe exited with error code 0.
      The caption portion does not appear..