bihuboliya has asked for the wisdom of the Perl Monks concerning the following question:
However, when I run the script I get the following error message:use warnings; use strict; use Net::SSH::Perl; my $command = "ls"; my $host = "192.168.112.191"; my $user = "admin"; my $pass = "admin\@123"; my $ssh = Net::SSH::Perl->new( $host ); $ssh->login( $user, $pass ); my($stdout, $stderr, $exit) = $ssh->cmd( $command ); print $stdout;
Permission denied at net_ssh_perl.pl line 12.
I have seen some posts with diverse opinion about using Net::SSH:Perl module. Posting this question expecting wisdom.
Please let me know if I should be looking for some alternatives to achieve my goal. In short, I want to run a command in a remote machine and want to know the output of the command.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Remote Execution of a Command in Linux Box
by marto (Cardinal) on Dec 10, 2013 at 10:30 UTC | |
by bihuboliya (Acolyte) on Dec 10, 2013 at 10:45 UTC | |
by Monk::Thomas (Friar) on Dec 10, 2013 at 12:08 UTC | |
by bihuboliya (Acolyte) on Dec 10, 2013 at 12:32 UTC | |
|
Re: Remote Execution of a Command in Linux Box
by hdb (Monsignor) on Dec 10, 2013 at 12:49 UTC | |
by Anonymous Monk on Dec 10, 2013 at 13:15 UTC | |
|
Re: Remote Execution of a Command in Linux Box
by Anonymous Monk on Dec 10, 2013 at 11:36 UTC | |
|
Re: Remote Execution of a Command in Linux Box
by Preceptor (Deacon) on Dec 10, 2013 at 22:07 UTC |