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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |