Hi all,
I have Cygwin installed and running on Windows machine. I can connect to and send certain commands like "ls","pwd". But when I try to change the directory I am gettign an exception. Here is my code:
use strict;
use warnings;
use Net::OpenSSH;
my $host = 'host';
my $username = 'user';
my $password = 'pass';
my $cmd1 = 'cd/';
my $cmd2 = 'ls';
my $ssh = Net::OpenSSH->new($host,
user => $username,
password => $password,
timeout => 30,
strict_mode => 0,
master_opts => [ -o => "StrictHostKeyChecking=no"]);
$ssh->error and
die "ssh failed: " . $ssh->error;
$ssh->system($cmd1) or
die "remote command failed: " . $ssh->error;
my ($out,$err) = $ssh->capture($cmd1);
$ssh->error and
die "remote command failed: " . $ssh->error;
$ssh->system($cmd2) or
die "remote command failed: " . $ssh->error;
($out, $err) = $ssh->capture2($cmd2);
$ssh->error and
die "remote command failed: " . $ssh->error;
thanks
--girija