I want to run a perl script on a remote server, it should login to a linux server via ssh and run a shell script with an argument, then print the results, please help......
I have a small script which will login and execute the ls command on the remote host, but i want to run a bash script instead.
use Net::SSH::Perl;
my $host = "xxxxx";
my $usr = "xxx";
my $pwd = "xxx";
my $ssh = Net::SSH::Perl->new($host);
$ssh->login($usr,$pwd);
my($stdout, $stderr, $exit) = $ssh->cmd("ls -l");
print "$stdout\n";
How can I execute the remote shell script instead of "ls -l"?