Greetings Brothers,

I must be candid and admit I'm not sure if I'm phrasing my question well, or if it even makes any sense at all.

Basically I'm looking for a way to safely make changes on remote servers.

For example, if I wanted to safely automate changing a user's password on my local machine, my first instinct is to search cpan for a perl module to use, such as Unix::PasswdFile, because I know that coders who are more experienced and skilled than I have "worked all the kinks out", and I don't want to reinvent the wheel.

However, I need to do this sort of thing remotely on multiple machines now. I've about decided that Net::OpenSSH appears to be the most stable and predictable way of interacting with my remote servers, but unfortunately, installing Unix::PasswdFile on the remote machine and executing a script I upload is not really tenable (and involves the same issues in any case--cpan is not always foolproof :-) ).

I guess what I'm wondering is if there is a generalized system for treating the remote machine as if it was local? Or a technique for handling the situation when complex, interactive behaviors are required? In the password example I've given, I'd really rather avoid reading/writing to pipes while executing /usr/bin/passwd on the remote machine, as a blocking issue could make the machine inaccessible, for example. Does that make any sense?


In reply to Using local perl modules on remote SSH by rastoboy

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.