Does the reputed Net::SSH::W32Perl rev 0.06 actually exist? People claim they have it, but soulcage.net is gone, and installing PPMs directly from there seemed to be involved... I've got ActiveState perl 5.8.8 build 822 installed. I got Net::SSH::W32Perl (rev 0.05) installed from the UWinnipeg PPM repository, and I'm trying to do a simple "Run a command on a Unix box" script. Most(?) importantly, I uninstalled Net::SFTP, Net::SSH::Perl, and Net::SSH::W32Perl, and installed only Net::SSH::W32Perl (and let it take care of its own dependencies) - that seems to have been some people's answer. I hit the getpwuid problem, I set HOME=something, and got around it. I couldn't authenticate against the ssh daemon on the other end, I got a public/private key pair set up and working - I can login. But as soon as I try a cmd(), I hang. Lots of people seem to have a similar issue, and I can't seem to find a fix. My script (with a couple things anonymized):
use Net::SSH::W32Perl; $host = "myserver"; $user = "myuserid"; my $ssh = Net::SSH::W32Perl->new($host, debug => 1, interactive => 0, use_pty => 0, identity_files => ["id_rsa"]); $ssh->login($user); $cmd = '/usr/bin/date > ~/date'; #my($out, $err, $exit) = $ssh->cmd($cmd); $ssh->cmd($cmd, "\n"); print "STDOUT: $out"; print "\n\n"; print "STDERR: $err"; print "\n\n"; print "ExitCode: $exit"; print "\n\n";
The results:
... client: Requesting service shell on channel 0. client: channel 1: new [client-session] client: Requesting channel_open for channel 1. client: Entering interactive session. client: Sending command: /usr/bin/date > ~/date client: Requesting service exec on channel 1. client: channel 1: send eof client: channel 1: open confirm rwindow 262143 rmax 16384 (and here we hang indefinitely)
I've redirected stdout in the command I'm sending, and I've left it non-redirected - no difference. I tried adding and removing the "\n" argument to the cmd() arg list - removing it drops the "client: channel 1: send eof" debug info, but that's all. I made sure to install only the W32Perl module, so it could manage its own dependencies - no difference. I know the command works - there's a ~/date file that's getting created on the server side... it's just that my client script hangs. Am I missing something? Is there any solution which does NOT involve installing the PPMs from a Soulcage repository that doesn't exist? Thanks!

In reply to Net::SSH::W32Perl rev 0.05, cmd hangs. Does Net::SSH::W32Perl 0.06 exist? by KalTorak

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.