in reply to User Authentication is not working in Net::SSH::W32Perl
First, my @sV = $ssh->cmd($cmd) doesn't work. Second, $ssh->close() doesn't work either. The best way is still what the module's documentation says:
#!/usr/bin/perl use strict; use warnings; use Net::SSH::W32Perl; my $host = 'host'; my $user = 'user'; my $pass = 'password'; my $cmd = 'ls'; my $ssh = Net::SSH::W32Perl->new( $host, debug => 1, protocol => 2 ); $ssh->login($user, $pass); my ($stdout, $stderr, $exit) = $ssh->cmd($cmd); print $stdout, "\n"; exit;
|
|---|