Hello everybody, im quite new to perl, but have to implement a SFTP-Connection to a Server via Perl on Windows, so far ive tested the Net::OpenSSH and Net::SFTP:Foreign modules, but with None of them i managed to connect to the Server. I am only allowed to use Windows and im not allowed to use Cygwin. This is my testing Code:
use strict; use Net::OpenSSH; my $host = "127.0.0.1"; my $user = "Admin"; my $port = "22"; #my $timeout = "5"; my $key = "C:/Users/BeckerB/Desktop/SFTP Schluessel/Private.ppk"; #$ssh_cmd = "C:/Users/BeckerB/Desktop/SDH1/applikation/model/modules/N +et/OpenSSH.pm"; print $key; my $ssh = Net::OpenSSH->new( $host, user=>$user, port=>$port, timeout= +>30, key_path=>$key ); print "\ntest1\n"; #$sftp = Net::SFTP::Foreign->new($host, user=>$user, key_path=>$key, s +sh_cmd=>); $ssh->error and die "Can't ssh to $host: " . $ssh->error; #$sftp->die_on_error("SSH connection failed"); print "\nok\n";
Anybody got an idea what i am doing wrong? Best regards
In reply to SFTP on Windows by Poolstar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |