in reply to Re^7: Problem using Net::OpenSSH->capture to su to another user
in thread Problem using Net::OpenSSH->capture to su to another user
The first command ran ok but for the scp_get the log file get scp'ied, but I'm getting : Killed by signal 1. # set_error(1 - control command failed: master ssh connection broken)my $BASE='/test'; @cmd='ls -lt '.$BASE.'/Logs/*.log'; my $ssh = Net::OpenSSH->new("$user:$pass\@$host", master_opts => [ +-o => "StrictHostKeyChecking=no" ]) or warn "Can't ssh to $host: " . +$ssh->error; if ($ssh->error) {print runlog "SSH connection to $host failed: " +. $ssh->error; die ; } my($stdout, $stderr)=$ssh->capture2({tty=>1},@cmd); #my($stdout, $stderr)=$ssh->capture2(@cmd); if ($stderr) {print "get logs failed $stderr\n";}else{print "$stdo +ut\n$exit";} $ssh = Net::OpenSSH->new("$user:$pass\@$host", master_opts => [-o +=> "StrictHostKeyChecking=no" ]) or warn "Can't ssh to $host: " . $ss +h->error; my($stdout, $stderr, $exit)=$ssh->scp_get({glob=>1},$BASE.'/Logs/* +.log','/var/tmp'); if ($stderr) {print "get logs failed $stderr\n";}else{print "$stdo +ut\n$exit"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Problem using Net::OpenSSH->capture to su to another user
by salva (Canon) on Jun 24, 2014 at 07:20 UTC | |
by Anonymous Monk on Jun 25, 2014 at 13:58 UTC | |
by salva (Canon) on Jun 28, 2014 at 07:34 UTC | |
by Anonymous Monk on Jul 01, 2014 at 20:00 UTC | |
by salva (Canon) on Jul 02, 2014 at 07:36 UTC | |
by Anonymous Monk on Jul 07, 2014 at 20:39 UTC |