A
A
Andrey Bondarchuk2015-03-03 08:04:38
Perl
Andrey Bondarchuk, 2015-03-03 08:04:38

How to create an SSH connection in perl under Windows?

I've been struggling with perl SSH connection under Windows for a couple of days. Tried Net::W32Perl, Net::SSH2, SFTP, even tried SSH::Any , but in most cases the script complains about getpwuid, which is not implemented by Windows.
Now the script is like this

#!/usr/bin/perl
use warnings;
use strict;
use Net::SSH2;
my $host = '255.255.255.255';
my ($user) = 'admin';
my ($pass) = 'admin';
my $ssh = Net::SSH2->new($host, user => $user, password => $pass);
$ssh -> connect ($host);

such a record produces the message odd number of elements in hash assignment.
Any ideas? Except switching to linux of course)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question