Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

SSH for windows

by BernieC (Beadle)
on Aug 07, 2018 at 11:35 UTC ( #1219986=perlquestion: print w/replies, xml ) Need Help??

BernieC has asked for the wisdom of the Perl Monks concerning the following question:

I need an SSH package for windows and I seem to be trapped. Net::OpenSSH and Net::SSH both require an installed ssh client, which I don't have. Net::SSH::Perl looks perfect. But:

Test Summary Report ------------------- t/01-compile.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 t/04-config.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 25 tests but ran 0. t/05-cipher.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/06-auth.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/06-circular.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/07-ed25519.t (Wstat: 512 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 2 Parse errors: Bad plan. You planned 5 tests but ran 1. Files=13, Tests=21, 2 wallclock secs ( 0.03 usr + 0.03 sys = 0.06 C +PU) Result: FAIL Failed 6/13 test programs. 2/21 subtests failed. dmake.exe: Error code 255, while making 'test_dynamic' SCHWIGON/Net-SSH-Perl-2.14.tar.gz C:\Perl64\site\bin\dmake.exe test -- NOT OK //hint// to see the cpan-testers results for installing this module, t +ry: reports SCHWIGON/Net-SSH-Perl-2.14.tar.gz Failed during this command: SCHWIGON/Net-SSH-Perl-2.14.tar.gz : make_test NO

I tried a notest install, but it seems that that didn't work either. Is there a windows win7 SSH client for perl or is there some workaround for the installation problems with Net::SSH::Perl? Thanks! /b\

Replies are listed 'Best First'.
Re: SSH for windows
by Corion (Pope) on Aug 07, 2018 at 11:38 UTC

    Have you looked at Net::SSH2?

    Strawberry Perl includes it, so you likely don't even have to install it on Windows.

      Activestate doesn't know about it and there's no libssh2 or ssh2.dll or whateverit might be called on windows on my win7 system. I tried installing Net::SSH2 and, not surprisingly, got

      Looking for libraries... Unable to find a working version of library ssh2 in the following dire +ctories:

      I've downloaded libssh2 to my nearby Unix system and it looks like it can be built for Windows but I haven't a clue how to do that. I'm guessing I have "make" machinery and a C compiler because CPAN uses that to build stuff. Off on another research project to see how to build libssh2. {a lot of packages take pity on us poor Windows folk and provide already compiled versions for windows. Alas, not libssh2.}

        By default ActiveState doesn't come with a C compiler, or build tools. Many CPAN modules contain no C code, pure perl so you may never had needed this so far. If you're going to be using Perl on windows you can make your life a lot easier by switching to Strawbery Perl, since it ships with a sane development environment, lots of additional modules and libraries as standard. libssh2 install doc. You can see how builds/packages everything.

        ActiveState tries to provide a pre-built Net::SSH2, but that automated build fails because there is no prebuilt libssh2 available. If all else fails, maybe you can ask the maintainers of Strawberry Perl how they build their Net::SSH2 and libssh2.

        I've also used a pipe to plink.exe to fetch output from a remote machine, but that means you'll be fighting quoting across shell commands, which rarely is fun.

Re: SSH for windows
by syphilis (Bishop) on Aug 07, 2018 at 15:04 UTC
    The following should work unless you're running perl-5.28.0:
    ppm install http://www.sisyphusion.tk/ppm/Net-SSH2.ppd
    Cheers,
    Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1219986]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2019-09-21 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (273 votes). Check out past polls.

    Notices?