|The stupid question is the question not asked|
Re: Problem in connecting to remote unix host via Net::SSH2 from windows machineby syphilis (Archbishop)
|on Jun 12, 2017 at 01:31 UTC||Need Help??|
I unable to judge weather the script actually succeeded in connecting the host and failed only in executing the the command which I have assigned for $cmd.
Yes, I think the connection has succeeded and the error is coming from the Linux host - though I doubt very much that "pwd" is in fact unknown to that host.
On Windows, I'm apparently not set-up to use the auth_keyboard authentication to my remote Linux host - instead of auth_keyboard, I use auth_pubkey.
Then, in order to get your script to work, I have to slightly alter your run_testsuite() sub to:
Update: Actually, your original sub works fine for me so long as I precede the call to $chan2->shell(); with $chan2->blocking(0); .
With $ssh2->debug(0), that outputs (as expected):
Maybe give that approach a go instead - if only to verify that your remote Linux host does understand "pwd".
With $ssh2->debug(1) it outputs:
which is also quite correct, but confusingly verbose.
If I include $chan2->blocking(0); (presently commented out), the debugging output becomes a little less verbose:
For your script, you could try setting blocking(0) and blocking(1) to see if that makes any difference. You might also try replacing:
And try anything else you can think of ;-)