I have tried installing Net::SFTP::Foreign via ppm but it apparently
relies on having an ssh command that it can call to establish a
connection to start with. I have not been able to find a Windows ssh
command that can be used as a batch command (as opposed to a GUI).
I tried installing LWP::Protocol::sftp but it seems to end up calling
the above module and so still needs an ssh command.
I also tried to manually install Net:FTPSSL (and its dependants
IO::Socket:SSL and Net::SSLeay), none of which seem to be available on
ActiveState, but this requires a "make", a command which Windows doesn't
seem to have (I usually work in Unix).
Can anyone suggest how to get one of the above options to work in
Windows? Or a different option?
Thanks and regards,
Ashley
***********************************************************************************
This e-mail, including any attachments to it, may contain confidential and/or personal information. If you have received this e-mail in error, you must not copy, distribute, or disclose it, use or take any action based on the information contained within it. Please notify the sender immediately by return e-mail of the error and then delete the original e-mail.
The information contained within this e-mail may be solely the opinion of the sender and may not necessarily reflect the position, beliefs or opinions of the organisation on any issue. This email has been swept for the presence of computer viruses known to the organisation’s anti-virus systems.
***********************************************************************************
I need to be able to do file transfers via SFTP from Perl (ActiveState)
in a Windows environment but I am having trouble finding a suitable Perl
module that works.
===================================
I use Net::SSH2 on ActivePerl for just this purpose:
perl-5.10:
ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/Net-SSH2.ppd
perl-5.8:
ppm install http://theoryx5.uwinnipeg.ca/ppms/Net-SSH2.ppd
Adapted (and untested) from an actual script I use:
##############################
use warnings;
use strict;
use Net::SSH2;
my $server = 'server.nameer';
my $ssh2 = Net::SSH2->new;
die "can't connect" unless $ssh2->connect($server);
print "Connected\n";
die "can't authenticate"
unless $ssh2->auth(username => 'user',
password => 'pass');
print "Authenticated\n";
my $sftp = $ssh2->sftp;
$ssh2->debug(1);
my @files = qw (file1 file2 file3);
my $dir = '/directory/on/server';
#Upload
for(@files) {
$ssh2->scp_put($_, "$dir/$_");
}
$ssh2->disconnect();
##########################
Cheers,
Rob
Hmmm ... not a very good adaptation - it actually uses scp, and $sftp is
>I can see a Net::SSH on ActiveState, but not Net::SSH2. Is this the same
>thing?
No, it's different - and there's no Net::SSH2 on the ActiveState ppm
repository.
If you want to give Net::SSH2 a try, just run the ppm command (that I posted
in my first reply) that's appropriate for the version of perl that you have.
Cheers,
Rob
Cygwin and Cygwin Perl and OpenSSH packages:
I have a mixed Windows/ Cygwin and Debian GNU/ Linux SOHO network and Ubuntu GNU/ Linux web hosting accounts, and built a backup/ archive/ shutdown solution using Bash and Perl scripts driving tar, gzip, and rsync over ssh.
HTH,
David
You need to add additional ppm repositories. You can find
Net::FTPSSL on either the Trouchelle or University of
Winnipeg repositories.
--
Ron
I have now been able to install the FTLSSL module I originally wanted
and make some progress at last.
Thanks a million. :-)
@shley
--
Ron
***********************************************************************************