in reply to Re^9: SSH2 for windows
in thread SSH2 for windows

Unfortunately, I can't really help much.

It's a bit of a worry that the exec tests failed (tests 63, 64, 65). That seems to be consistent with the failure that you reported in your initial post. I was hoping those tests would pass.

Seems there's no-one here that is both willing and able to be of much help. Try contacting the author - and provide him with the test results and other relevant info (such as client and server OS types, and the fact that the server handles things fine from the shell). It might also be relevant that you're using a version of Net::SSH2 that has been hacked to work with perl 5.6 - so inform him of that, too. The hack is fairly simple - and can be found in the bug report at http://rt.cpan.org/Public/Bug/Display.html?id=22821

Is it possible for you to upgrade to perl 5.8 ? It may not fix the problem, but at least it would remove any doubts regarding the validity of the hacking that has been done in order to get Net::SSH2 built for perl 5.6.

Cheers,
Rob
Update:On my Mandrake Linux box (running perl 5.8.8) I have just installed OpenSSH from the installation disks. I then built and installed (on the same Linux box) libssh2-0.14 and Net-SSH2-0.09. Net-SSH2 builds and tests fine for me on that Linux box. (I ran the tests against the sshd server that's now running on the same box.)

However, when it comes to running Net-SSH2 from my Win32 box (connecting to the sshd server on my Linux box), I get much the same as you. Actually, it's even worse with perl 5.8, than with perl 5.6, as there's a "Free to wrong pool ... " error (at the end of test 22) with perl 5.8 that kills the test suite. With perl 5.6, I get the same failures as you - plus one additional failure. For me scp_put() fails. (Any idea why that might be ?)The directory and the file both get created on my Linux box, but nothing gets written to the file. For some reason the test script also fails to exit after all of the tests have been run.

Looks like there's a few bugs in Net-SSH2 to sort out wrt Win32 :-)

Replies are listed 'Best First'.
Re^11: SSH2 for windows
by shanthiann (Acolyte) on Feb 06, 2007 at 13:23 UTC
    Hi PerlMonks and Rob
    hope Net::SSH2 fixed in windows.
        Hi Perl Monks and Rob,
        i have installed libssh2-0.14 from http://www.libssh2.org>, openssl-0.9.8b and zlib-1.2.3 to linux box.
        working fine.just check the code and output.We can also hold the session.
        #!/usr/bin/perl use warnings; use strict; use Net::SSH2; my $ssh2 = Net::SSH2->new(); $ssh2->connect('$hostname') or die "Unable to connect Host $@ \n"; $ssh2->auth_password('$user','$passwd') or die "Unable to login $@ \n" +; my $chan2 = $ssh2->channel(); $chan2->shell(); print $chan2 "cd shanthi_backup\n"; print $chan2 "pwd\n"; print "LINE : $_" while <$chan2>; print $chan2 "ls -lrt\n"; print "LINE : $_" while <$chan2>;
        output
        LINE : Running .profile...
        LINE : YOU HAVE NEW MAIL
        LINE : /home/shanthi/shanthi_backup
        LINE : total 6873
        LINE : -rw-r--r-- 1 shanthi ccdata3 83917 Dec 21 07:46 cmtool_latest.pl
        LINE : -r-xr-xr-x 1 shanthi ccdata3 22141 Jan 04 06:07 synctree
        LINE : drwxrwxr-x 2 shanthi ccdata3 4096 Jan 05 07:57 perl
        LINE : -rwxrwxr-x 1 shanthi ccdata3 2040 Jan 05 07:57 ctrlmfindnew.pl
        LINE : -rw-rw-r-- 1 shanthi ccdata3 25 Jan 27 14:15 test.pl
        LINE : -rw-rw-r-- 1 shanthi ccdata1 0 Feb 07 13:04 a.txt
        LINE : -rwxr-xr-x 1 shanthi ccdata3 7193 Feb 07 13:07 csv.pl
Re^11: SSH2 for windows
by Anonymous Monk on May 22, 2007 at 11:17 UTC
    Hi Rob
    Net::SSH2 will work all functionality in Windows using 5.6.1
      You mean all tests pass ? Or is it just the functionality that you required that works.

      I haven't taken a look for a while, but I thought there were a couple of tests that failed under both perl 5.8.8 and perl 5.6.1.

      Mind you, I haven't tried version 0.10 (and was unaware that it even existed) - perhaps this most recent version has fixed some things. Which version of Net::SSH2 and libssh2 are you using ?

      Cheers,
      Rob