Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Perl Module Installation

by misteradey (Initiate)
on Dec 10, 2020 at 11:29 UTC ( #11124949=perlquestion: print w/replies, xml ) Need Help??

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

Dear Monks, I have a situation where my server only has "copy & paste" connectivity to "The Internet". The server has standard Perl installation. I need to install Net::SSH. Is this possible using only copy & paste? ( I can download source code from other devices and get text into copy buffer to paste into said server ). Your Humble Servant.

Replies are listed 'Best First'.
Re: Perl Module Installation
by davido (Cardinal) on Dec 10, 2020 at 17:26 UTC

    I would handle this either through operating system level package management tools (yum, apt, etc.), or through containerization, or through setting up a MiniCPAN or DarkPAN. And I've done all three of those for different situations. Your organization must have some way of keeping servers updated, and installing software on them.

    However, Net::SSH is pure Perl. And every dependency it requires ships with Perl 5. You should be able to do one of two things (in order of preferability):

    1. Download the tarball, unpack it, and run the mantra; perl Makefile.PL && make && make test && make install
    2. Copy the code itself into a Net/ path within one of your @INC paths. This is actually the copy/paste approach.

    The first solution has the advantage that it's predictable and repeatable. So long as the module's maintainers don't add external dependencies, it will always work. And you can hold onto that tarball should you ever need to reinstall the same version. The second solution's advantage is that it lets you work with a clear-text source code, which is easy to copy and paste. Ok, there's a third alternative; you unpack the tarball on a build system, and then copy/paste each file in the distribution into a build directory on the target box. That seems like too much work.

    If your server can be hit over SSH, then you have scp or sftp, probably. Establishing a build server somewhere in network proximity wouldn't be awful, unless there are real security requirements that prevent that happening.


Re: Perl Module Installation
by stevieb (Canon) on Dec 10, 2020 at 16:35 UTC

    Check out minicpan. It allows you to save a complete copy of the CPAN (which includes only the most recent release of each distribution) locally, which you can then copy over to your offline systems, and use it as if you were using the online version.

    I've never used it myself, but I know others who have, and it's specifically used for situations such as this. With one person I know, they have used it for years so that they can do testing and development while on flights (nowadays airlines have onboard wifi for the most part, but I digress).

    Perhaps some of these users can speak up with their experiences.

Re: Perl Module Installation
by hippo (Chancellor) on Dec 10, 2020 at 11:50 UTC

    Yes, it probably is possible. But if your server only has "copy & paste" connectivity to "The Internet" what good will Net::SSH be?


      But if your server only has "copy & paste" connectivity to "The Internet" what good will Net::SSH be?

      I understand the sentiment, and it made for a ++funny reply. But in the OP's defense, it's quite possible (and probably not uncommon) to have a local network isolated from the internet as a whole, where it still makes sense to use SSH to communicate between the nodes in the LAN.

      To misteradey's question, trying to add confirmation to what you just said: it does appear that Net::SSH is pure-Perl (and thus could copy/paste) and doesn't have any non-core dependencies that I noticed (so wouldn't require copy/pasting other modules to get Net::SSH to work).

        Thank you. In my defence - this server is indeed part of a network with many thousands of devices, which I need to control via SSH (from the server). None of which have access to the Internet.

        Agreed, at work we have no internet connected systems at all.

      Obviously he'd be copying and pasting the packets back and forth after they're received via avian carrier and typed in / printed out . . .

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

        Well yanno, as drive densities increase and get smaller, this type of transmission is seeing a resurgence in utility :)
Re: Perl Module Installation
by perlfan (Vicar) on Dec 11, 2020 at 18:57 UTC
    Seems like if you can ssh into said remote server, you can scp into it? Or maybe not you said it's restrictive. Or is this a serial connection? If this is the case, and it's been a long time since I've messed with it, 'kermit' might allow you to push files over to this machine (if it is a serial connection).

    Seek and ye shall find - - i.e., if this is indeed your situation. Hope that helps.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11124949]
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2021-05-17 19:58 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (161 votes). Check out past polls.