Reputation: 11
I have a Perl script which access a remote machine using openssh and executes a Perl script in that remote machine.
Now the problem is that the script which needs to be executed in remote machine is an interactive script and expects some input during execution through STDIN.
Could some one help me with the implementation of this scenarion.
I am placing the snippet of code which I have implemented till now.
my $ssh = Net::OpenSSH->new("$host", timeout => 60) or die "unable to connect to remote host: ". $ssh->error;
$ssh->system("chmod 755 abc.pl");
my $output=$ssh->capture("./abc.pl") or die "remote command failed: " . $ssh->error;
Upvotes: 1
Views: 135
Reputation: 21
if you are having the execution done automatically then you will not be able to ask for input from a user. you will have to run the script manually or you will have to modify the script on the remote server to accept variables from the remote execute.
Upvotes: 1