- Posted In
- Red Hat Enterprise Linux
I wrote a simple Perl script try to make a connection to remote server and run command. But came up some message I don’t what is about.
Here is the Perl script:
my $host = "127.0.0.1";
my $user = "me";
my $password = "pass";
#-- set up a new connection
my $ssh = Net::SSH::Perl->new($host);
#-- execute the command
my($stdout, $stderr, $exit) = $ssh->cmd("ls -l /home/$user");
and here is the error message:
Can't locate Net/SSH/Perl.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ssh_test.pl line 3.
BEGIN failed--compilation aborted at ssh_test.pl line 3.
You might have to install per-Net-SSH packages for this. Unfortunately these packages are not available officially from Red Hat.
One place you can look for them is at epel.
Look for perl-Net-SSH in the last link.
Please note that the above packages are not officially supported by Red Hat since it's not provided by Red Hat.