J
John Call
I am trying to run a program on machine B from machine A. I need to
SSH from A to B, run the program which will ask for a password
interactively, give it the password and then disconnect.
I came across Except but cannot see how to ssh and then inside the ssh
I initiate run the program.
I have written some code with Net::SSH:erl that connects and runs
the program but it asks for the password at my command line and won't
accept it from the program.
Code:
-----------------------------
use Net::SSH:erl;
require '/storage/mu/etc_defaults.pl';
$cmd = $radius_restart_cmd;
my %params = (
protocol => 2,
);
my $ssh = Net::SSH:erl->new($radius_host, %params);
$ssh->login('root', $radius_su);
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
my($stdout, $stderr, $exit) = $ssh->cmd('admin');
$ssh->debug($msg);
print "\n\n'$stdout' '$stderr' '$exit'\n\n";
-------------------
Thanks ahead of time for any ideas.
I know I should pass the password as plain text but this is just a
test and I'll clean that up later.
John Call
SSH from A to B, run the program which will ask for a password
interactively, give it the password and then disconnect.
I came across Except but cannot see how to ssh and then inside the ssh
I initiate run the program.
I have written some code with Net::SSH:erl that connects and runs
the program but it asks for the password at my command line and won't
accept it from the program.
Code:
-----------------------------
use Net::SSH:erl;
require '/storage/mu/etc_defaults.pl';
$cmd = $radius_restart_cmd;
my %params = (
protocol => 2,
);
my $ssh = Net::SSH:erl->new($radius_host, %params);
$ssh->login('root', $radius_su);
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
my($stdout, $stderr, $exit) = $ssh->cmd('admin');
$ssh->debug($msg);
print "\n\n'$stdout' '$stderr' '$exit'\n\n";
-------------------
Thanks ahead of time for any ideas.
I know I should pass the password as plain text but this is just a
test and I'll clean that up later.
John Call