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...:
Getting an error while executing a prog for SSH remote server

 



nsk@perl
New User

Aug 7, 2010, 6:50 AM

Post #1 of 4 (2072 views)
Getting an error while executing a prog for SSH remote server Can't Post

I am trying to execute a program for connecting to a remote host and execute some commands . Here is the code .

usr/bin/perl -w

# Program to ssh remote server

use Net::SSH::Perl;

my $host = "192.168.24.22";
my $user = "xyz";
my $password = "xxx";

#-- set up a new connection
my $ssh = Net::SSH::Perl->new($host);
#-- authenticate
$ssh->login($user, $password);
#-- execute the command
#my($stdout, $stderr, $exit) = $ssh->cmd("ls -l /home/$user");



but iam geeting below error :

Can't locate Crypt/DH.pm in @INC (@INC contains: usr/lib/perl5/5.8.8/sun4-solaris usr/lib/perl5/5.8.8 usr/lib/perl5/site_perl/5.8.8/sun4-solaris /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl .) at /usr/lib/perl5/site_perl/5.8.8/Net/SSH/Perl/Kex/DH1.pm line 13.

Can one please help me reagrding this . I am in middile some important project which is based on this ....... plz helpp.


deepeshtronics
Novice

Aug 8, 2010, 1:41 AM

Post #2 of 4 (2035 views)
Re: [nsk@perl] Getting an error while executing a prog for SSH remote server [In reply to] Can't Post

Hi,

Basically, the module "Net::SSH::Perl" has a lot of dependencies on other modules like one "Crypt::DH".

The module 'Crypt::DH' is used for generating private and public keys.

Install this module in your machine and try to run your code again.

Let me know if you face any other problem.

Thanks


(This post was edited by deepeshtronics on Aug 8, 2010, 8:59 AM)


nsk@perl
New User

Aug 8, 2010, 5:31 AM

Post #3 of 4 (2019 views)
Re: [nsk@perl] Getting an error while executing a prog for SSH remote server [In reply to] Can't Post

Thanks for prompt response ...

I already installed that module . But I am getting an error saying "Can't locate Crypt/DH.pm" . I checked in that path aand there is no file witthat name but insted of that there is a file DH1.pm.

My doubt is while running the program why it is checking for DH.pm instead of DH1.pm.

Is there any way to configure this ..

Please help out in this ..............................


deepeshtronics
Novice

Aug 8, 2010, 8:55 AM

Post #4 of 4 (2001 views)
Re: [nsk@perl] Getting an error while executing a prog for SSH remote server [In reply to] Can't Post

Hi,

If you have already installed the module "Crypt::DH" properly, this error should have not come. If you have installed it then files are not in correct path.

DH1.pm is different module from DH.pm

Do as written below.

Quote
Open a file lets say "filename".
write "use Crypt::DH;"
save and close the file.
then compile the file with "perl -c filename".

If you face same problem it means "Crypt::DH" is not installed and try to reinstall it. If not, it means "Crypt::DH" is installed.


Quote
see line 13 of the file "/usr/lib/perl5/site_perl/5.8.8/Net/SSH/Perl/Kex/DH1.pm" has "use Crypt::DH;".


Let me know your response. I will try to help you in fixing this problem.

Thanks


(This post was edited by deepeshtronics on Aug 8, 2010, 9:01 AM)

 
 


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

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