CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
SSH using Perl

 



charane1982
New User

Aug 24, 2006, 8:38 AM

Post #1 of 3 (1612 views)
SSH using Perl Can't Post

Hi,

I need a script to ssh to a machine using Perl.

I am using Net::SSH, with all the prerequisites

My code is

#!/usr/bin/perl
BEGIN
{
$host = "10.10.10.10";
$user = "root";
$pass = "redhat123";
}
use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new($host);
$ssh->login($user,$pass);

$ssh->cmd("ls");


the error i am getting is

Can't locate loadable object for module Math::GMP in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at /usr/lib/perl5/5.8.0/Net/SSH/Perl/Util/SSH1MP.pm line 7
Compilation failed in require at /usr/lib/perl5/5.8.0/Net/SSH/Perl/Util/SSH1MP.pm line 7.
BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.0/Net/SSH/Perl/Util/SSH1MP.pm line 7.
Compilation failed in require at /usr/lib/perl5/5.8.0/Net/SSH/Perl/Util.pm line
56.
BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.0/Net/SSH/Perl/Key/RSA1.pm line 6.
Compilation failed in require at /usr/lib/perl5/5.8.0/Net/SSH/Perl/SSH1.pm line
13.
BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.0/Net/SSH/Perl/SSH1.pm line 13.
Compilation failed in require at /usr/lib/perl5/5.8.0/Net/SSH/Perl.pm line 54.


Please help me out

Also please send a brand new script


KevinR
Veteran


Aug 24, 2006, 2:01 PM

Post #2 of 3 (1610 views)
Re: [charane1982] SSH using Perl [In reply to] Can't Post

actually you are using Net::SSH::Perl

have you tried using just Net::SSH ?
-------------------------------------------------


charane1982
New User

Aug 27, 2006, 8:57 PM

Post #3 of 3 (1600 views)
Re: [KevinR] SSH using Perl [In reply to] Can't Post

i am using Net::SSH...the problem was with my Perl...it was 5.0.0 build...very old one...upgraded to 5.8.8 and now its working fine...thanks all for your co-operation

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives