Hi All,

I need to do SFTP without user interaction (ie., giving password and input file and output path to sftp). For that i came to know NET::SFTP is the perl module is used for without user interaction.

But unfortunately i do not have that module in my unix box and i don't have the permission to install. for that i tried like downloaded that NET::SFTP and that required module NET::SSSH::Perl. even though it shows below error.

Can't locate Math/Pari.pm in @INC (@INC contains: Net/SSH/Perl Net/* /opt/perl/lib/5.8.1/PA-RISC2.0 /opt/perl/lib/5.8.1 /opt/perl/lib/site_perl/5.8.1/PA-RISC2.0 /opt/perl/lib/site_perl/5.8.1 /opt/perl/lib/site_perl . /dso/xyz/apps/perl) at Net/SSH/Perl/Util/SSH2MP.pm line 6.
BEGIN failed--compilation aborted at Net/SSH/Perl/Util/SSH2MP.pm line 6.
Compilation failed in require at Net/SSH/Perl/Util.pm line 56.
BEGIN failed--compilation aborted at Net/SFTP/Buffer.pm line 9.
Compilation failed in require at Net/SFTP/Attributes.pm line 7.
BEGIN failed--compilation aborted at Net/SFTP/Attributes.pm line 7.
Compilation failed in require at Net/SFTP.pm line 8.
BEGIN failed--compilation aborted at Net/SFTP.pm line 8.
Compilation failed in require at sftp_test_part1.pl line 9.
BEGIN failed--compilation aborted at sftp_test_part1.pl line 9.



#!/usr/local/bin/perl -w use FindBin qw($Bin); BEGIN{ unshift(@INC, 'Net'); unshift(@INC, 'Net/SFTP'); unshift(@INC, 'Net/SSH/Perl'); unshift(@INC, 'Net/SSH/Perl/Util'); } use Net::SFTP; use Net::SSH::Perl; my $host = "abc.account.com"; my %args = ( user => 'chshtst', password => '4getmenot', debug => 'true' ); my $sftp = Net::SFTP->new($host, %args); print "connected!"; $sftp->put("/from/path/file.pm", "/to/path"); print "done!\n";

Not sure what is the problem here and how to resolve it. I am using Perl 5.8.1 on Unix (HP-UX)

Thanks,
Shanmugam A.


In reply to SFTP with out perl module by shan_emails

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.