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

Hello, I usually play with perl on linux, but for once I'm tasked to add a module on a Win2008 Server. Of course, I can't have any compilation tool on this server.
The goal is to add Net::SFTP.
Reading the doc, I found I should use ppm : I've added a repo (www.sisyphusion.tk).
It turns out I can't sync it
ppm> repo sync --force 2 Downloading www.sisyphusion.tk packlist...redirect ppm> repo list id pkgs name 1 11416 ActiveState Package Repository 2 0 www.sisyphusion.tk
I've tried to specifiy the module directly, but got an error :
ppm> install http://www.sisyphusion.tk/ppm/Net-SFTP-Foreign-Backend-Ne +t_SSH2.ppd --force ppm install failed: 501 Protocol scheme 'https' is not supported (Cryp +t::SSLeay not installed)
So, OK, you need Crypt::SSLeay to be able to do https : why not, let's do this :
ppm> install Crypt::SSLeay Downloading ActiveState Package Repository packlist...not modified Downloading Crypt-SSLeay-0.57...redirect Downloading Crypt-SSLeay-0.57...redirect ppm install failed: 501 Protocol scheme 'https' is not supported (Cryp +t::SSLeay not installed)
Wait... What !! I need Crypt::SSLeay to install Crypt::SSLeay ?? What am I missing here ? More info :
C:\Users\bla>perl -v This is perl, v5.8.8 built for MSWin32-x86-multi-thread (with 18 registered patches, see perl -V for more detail) C:\Users\bla>ppm-shell -v ppm 4.01 Copyright (C) 2007 ActiveState Software Inc. All rights reserved.

Replies are listed 'Best First'.
Re: Add Net::SFTP for Win 2008
by salva (Canon) on Feb 18, 2016 at 11:27 UTC
    Net::SFTP and Net::SFTP::Foreign are two different modules. Net::SFTP::Foreign::Backend::Net_SSH2 allows one to run Net::SFTP::Foreign on top of Net::SSH2.

    If you just want to run a few SFTP transfers from Windows, the easiest way is to use Net::SFTP::Foreign with plink (from the PuTTY project), though plink is not very fast. Using the Net::SSH2 backend is usually faster, but that package requires a compiler to be installed or a precompiled package. Alternatively, if you are allowed to switch your perl, Strawberry Perl has it by default.

    Finally, if your scripts are already written around Net::SFTP, you can switch them to use Net::SFTP::Foreign::Compat which provides a (mostly) compatible API on top of Net::SFTP::Foreign.

    If you decide to stick to Net::SFTP, then you will have to install Net::SSH::Perl and all of its dependencies, including the daunting Math::PARI!

Re: Add Net::SFTP for Win 2008
by marto (Cardinal) on Feb 18, 2016 at 11:30 UTC
      OK, I might have not been very precise :
      My goal is to be able to do SFTP from the Windows server, whatever module I use, I don't really mind (for now...).

      Following your advice, I tried to install Net::SFTP::Foreign :
      ppm> install Net::SFTP::Foreign Downloading www.sisyphusion.tk packlist...redirect Downloading Net-SFTP-Foreign-1.53...redirect Downloading Net-SFTP-Foreign-1.53...redirect Downloading Net-SFTP-Foreign-1.53...failed 500 Can't locate object met +hod "new" via package "LWP::Protocol::https::Socket" ppm install failed: 500 Can't locate object method "new" via package " +LWP::Protocol::https::Socket" ppm> install LWP::Protocol::https::Socket ppm install failed: Can't find any package that provide LWP::Protocol: +:https::Socket
      I thought maybe the 2nd repo was a problem, so deleted it, and retried :
      ppm> repo delete 2 Repo 2 deleted. ppm> install Net::SFTP::Foreign Downloading Net-SFTP-Foreign-1.53...redirect Downloading Net-SFTP-Foreign-1.53...redirect ppm install failed: 501 Protocol scheme 'https' is not supported (Cryp +t::SSLeay not installed)
      Same error, again
      Any recommendation ?
        ppm install failed: 501 Protocol scheme 'https' is not supported ...

        Seems odd to me that https is being called on to download from a http site.
        I've not seen this sort of error before with PPM.

        UPDATE: Try running 'ppm log' (or just 'log' if you're in the ppm shell) immediately after the error has happened. That will hopefully give a better idea of what's going wrong.

        There are, however, other problems with the sisyphusion repo at the moment. The hosts have messed with its accessibility again, so it looks like I'll have to contact them .... again.
        I keep getting "403 forbidden" errors - even though all files are readily available via the browser.
        Last time this happened they had to "whitelist one of ModSecurity rules", so I guess some dickhead has messed with those rules again.

        You can still install Net-SSH2 on your perl-5.8.8 by grabbing http://www.sisyphusion.tk/ppm/x86/Net-SSH2-58.tar.gz.
        Place that file in some directory along with the following file named Net-SSH2.ppd:
        <?xml version="1.0" encoding="UTF-8" ?> <SOFTPKG NAME="Net-SSH2" VERSION="0,56,0,0"> <TITLE>Net-SSH2</TITLE> <ABSTRACT>Support for the SSH 2 protocol via libssh2</ABSTRACT> <AUTHOR>Rafael Kitover</AUTHOR> <PROVIDE NAME="Net::SSH2" VERSION="0.56" /> <IMPLEMENTATION> <OS NAME="MSWin32" /> <ARCHITECTURE NAME="MSWin32-x86-multi-thread-5.8" /> <CODEBASE HREF="Net-SSH2-58.tar.gz" /> </IMPLEMENTATION> </SOFTPKG>
        (Beware of line wrapping if you copy'n'paste that code.)

        Then 'cd' to that directory and run:
        ppm install Net-SSH2.ppd --force
        Then go through the same rigmarole for Net-SFTP-Foreign and Net-SFTP-Foreign-Backend-Net_SSH2 .... yuk !!

        Grab http://www.sisyphusion.tk/ppm/x86/Net-SFTP-Foreign-58.tar.gz and http://www.sisyphusion.tk/ppm/x86/Net-SFTP-Foreign-Backend-Net_SSH2-58.tar.gz.

        Net-SFTP-Foreign.ppd needs to be:
        <?xml version="1.0" encoding="UTF-8" ?> <SOFTPKG NAME="Net-SFTP-Foreign" VERSION="1,77,0,0"> <TITLE>Net-SFTP-Foreign</TITLE> <ABSTRACT>Secure File Transfer Protocol client</ABSTRACT> <AUTHOR>Salvador Fandino Garcia</AUTHOR> <PROVIDE NAME="Net::SFTP::Foreign" VERSION="1.77" /> <IMPLEMENTATION> <OS NAME="MSWin32" /> <ARCHITECTURE NAME="MSWin32-x86-multi-thread-5.8" /> <CODEBASE HREF="Net-SFTP-Foreign-58.tar.gz" /> </IMPLEMENTATION> </SOFTPKG>
        Net-SFTP-Foreign-Backend-Net_SSH2.ppd needs to be:
        <?xml version="1.0" encoding="UTF-8" ?> <SOFTPKG NAME="Net-SFTP-Foreign-Backend-Net_SSH2" VERSION="0,09,0,0"> <TITLE>Net-SFTP-Foreign-Backend-Net_SSH2</TITLE> <ABSTRACT>Run Net::SFTP::Foreign on top of Net::SSH2</ABSTRACT> <AUTHOR>Salvador Fandino Garcia</AUTHOR> <PROVIDE NAME="Net::SFTP::Foreign::Backend::Net_SSH2" VERSION="0.0 +9" /> <IMPLEMENTATION> <OS NAME="MSWin32" /> <ARCHITECTURE NAME="MSWin32-x86-multi-thread-5.8" /> <CODEBASE HREF="Net-SFTP-Foreign-Backend-Net_SSH2-58.tar.gz" / +> </IMPLEMENTATION> </SOFTPKG>
        (Again - beware of line wrapping if you copy'n'paste that code.)

        I'll report back here once I've verified that accessibility to the sisyphusion repo has been restored. (I'm actually currently able to access it with the PPM that ships with StrawberryPerl, but not the one that ships with ActivePerl-5.8.9 .... strange.)

        Cheers,
        Rob
Re: [SOLVED] Add Net::SFTP for Win 2008
by Discipulus (Canon) on Feb 18, 2016 at 22:48 UTC
    Of course, I can't have any compilation tool on this server.

    As side note, maybe you are happy to know that is possible and frequent to have such tools at disposal and, most important, working. strawberryperl release notes contains 34 external tools and among them binutils and make and dmake and gcc so that you can feel more comfortable while in shaggy environments.

    During lasts yaers i had no problems with cpan or cpanp clients that sheep with StrawberryPerl.

    Just for your info.

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.