#!/usr/bin/perl -w use strict; use Net::SSH2::Perl; my $host = "10.160.12.26"; my $sshusername = "mktftp"; my $sshpasswd = "markdb"; print "Start\n"; my $ssh = Net::SSH2::Perl->new($host, debug => 1, protocol => 2); print "Before login\n"; my $loginStatus = $ssh->login($sshusername,$sshpasswd); print "After login\n"; my $command = "date"; my $stdout; my $stderr; my $exit; eval { ($stdout,$stderr,$exit) = $ssh->cmd($command); }; if ($@) { if ($@ =~ m/Permission denied/i) { print "Authentication failed\n"; exit 1; } } print "$stdout\n"; #### Can't locate Net/SSH2/Perl.pm in @INC (you may need to i rl module) (@INC contains: C:/Strawberry/perl/site/lib C /lib C:/Strawberry/perl/lib .) at C:\\conn.pl line 4. BEGIN failed--compilation aborted at C:\\conn.pl line 4.