in reply to Net::OpenSSH pass options to ssh
Hello zn553,
Welcome to the Monastery. You can find what you are looking for and much more here Re: SSHing in multiple servers and execute command on each.
Update: Minimal example with code see here: Re: Perl script works differently from Apache then CMD line.
Update2: Sample of code with multiple commands in one of the links that I provide you Re: Simple SSH based chat client:
my ($stop, $pid_stop) = $ssh->open2pty("sudo -k; sudo service ntp stop +") or die "open2pty failed: " . $ssh->error . "\n";
From the module documentation Net::OpenSSH/Net::OpenSSH methods:
($in, $out, $err, $pid) = $ssh->open_ex(\%opts, @cmd)
Hope this helps, BR.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Net::OpenSSH pass options to ssh
by zn553 (Initiate) on Mar 18, 2019 at 15:26 UTC | |
by salva (Canon) on Mar 19, 2019 at 12:00 UTC | |
by thanos1983 (Parson) on Mar 18, 2019 at 15:49 UTC |