in reply to How to execute and capture output of remote commands using Net::SSH2

Which version of libssh2 are you using? For proper error handling you need version 1.7.0.

Anyway, I have uploaded a new version of the module (0.63) that now generates errors that would point you to the line in your script where they happened... even if they don't tell you the cause!

Finally, don't disable blocking mode unless you know what you are doing.

  • Comment on Re: How to execute and capture output of remote commands using Net::SSH2

Replies are listed 'Best First'.
Re^2: How to execute and capture output of remote commands using Net::SSH2
by thanos1983 (Parson) on Oct 26, 2016 at 15:16 UTC

    Hello Salva

    You are absolutely right, I am running libssh2-1:amd64                               1.5.0-2                                       amd64        SSH2 client-side library this is why I can not see a proper error code.

    Unfortunately this is the version that cane with the latest openssh-server/client on my distribution. I also know that on Ubuntu libssh2 has 3 active bugs, see libssh2 package in Ubuntu .

    Most likely the solution to my problem would be to install libssh2 1.7.0-1 as you suggest. Thank you for your time and effort reading and replying to my question.

    Seeking for Perl wisdom...on the process of learning...not there...yet!
      In Linux, usually, Net::OpenSSH is easier to use and doesn't need any dependency besides the binary ssh client.