windows - Perl Net::SFTP::Foreign Plink connection issue -
firstly i'm complete sftp & ssh newbie, , pretty new perl. trying write script connect remote server , retrieve files. both servers windows 2003 boxes. have installed sftp server on server , can connect using filezilla client same ip adress (removed code sample security reasons), username, , port number specified in code.
the connection block of code have is:
my $sftp = net::sftp::foreign->new( host => 'xx.xxx.xxx.xxx', user => 'radiospx', port => '22', ssh_cmd => "c:\\program files\\putty\\plink.exe", more => [qw(-v -i )] ); $sftp->error , die " ssh connection failed: " . $sftp->error; when run script following output:
looking host "sftp" unable open connection: host not exist ssh connection failed: connection remote server broken @ import.pl line 34
can suggest i'm going wrong. server accepting sftp connections filezilla works perfectly.
the -i plink option passing through more requires argument:
my $sftp = net::sftp::foreign->new( host => 'xx.xxx.xxx.xxx', user => 'radiospx', port => '22', ssh_cmd => "c:\\program files\\putty\\plink.exe", more => ['-v', -i => "c:\\path\\to\\the\\private.key"] ); $sftp->error , die " ssh connection failed: " . $sftp->error;
Comments
Post a Comment