Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > i need to ssh to remote server using Perl

Reply
Thread Tools

i need to ssh to remote server using Perl

 
 
vish.chitnis@gmail.com
Guest
Posts: n/a
 
      09-11-2006
i am trying to connect to remote machine using Perl..here is wht i have
found..in the net
use Net::SSH:erl;
my $ssh = Net::SSH:erl->new($host);
$ssh->login($user, $pass);
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
when i give my hostname and other details, the compilation error i get
is
Can't locate Net/SSH/Perl.pm in @INC (@INC contains: c:/Perl/lib
c:/Perl/site/li
b .) at sshperl.pl line 1.
BEGIN failed--compilation aborted at sshperl.pl line 1.
whether i need to install any module for this

thanks
vish

 
Reply With Quote
 
 
 
 
Binod Pant
Guest
Posts: n/a
 
      09-11-2006
In my ActiveState Perl installation, I see the directory
C:\Perl\site\lib\URI

which has the ssh.pm file.
See if you have this installed. If not, use CPAN to install NET::SSH or any
other library you require.

normally I do

>> perl -MCPAN -e shell

cpan> install packagename

that's it!

HTH
Binod.

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>i am trying to connect to remote machine using Perl..here is wht i have
> found..in the net
> use Net::SSH:erl;
> my $ssh = Net::SSH:erl->new($host);
> $ssh->login($user, $pass);
> my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
> when i give my hostname and other details, the compilation error i get
> is
> Can't locate Net/SSH/Perl.pm in @INC (@INC contains: c:/Perl/lib
> c:/Perl/site/li
> b .) at sshperl.pl line 1.
> BEGIN failed--compilation aborted at sshperl.pl line 1.
> whether i need to install any module for this
>
> thanks
> vish
>



 
Reply With Quote
 
 
 
 
vish.chitnis@gmail.com
Guest
Posts: n/a
 
      09-11-2006
hi Binod
thanks for ur quick reply, i have verified that and found that the flie
ssh.pm does exist in the proper location..

still i have to install the package? if yes wht is the package name
shall i give


thanks
vish
Binod Pant wrote:
> In my ActiveState Perl installation, I see the directory
> C:\Perl\site\lib\URI
>
> which has the ssh.pm file.
> See if you have this installed. If not, use CPAN to install NET::SSH or any
> other library you require.
>
> normally I do
>
> >> perl -MCPAN -e shell

> cpan> install packagename
>
> that's it!
>
> HTH
> Binod.
>
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
> >i am trying to connect to remote machine using Perl..here is wht i have
> > found..in the net
> > use Net::SSH:erl;
> > my $ssh = Net::SSH:erl->new($host);
> > $ssh->login($user, $pass);
> > my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
> > when i give my hostname and other details, the compilation error i get
> > is
> > Can't locate Net/SSH/Perl.pm in @INC (@INC contains: c:/Perl/lib
> > c:/Perl/site/li
> > b .) at sshperl.pl line 1.
> > BEGIN failed--compilation aborted at sshperl.pl line 1.
> > whether i need to install any module for this
> >
> > thanks
> > vish
> >


 
Reply With Quote
 
Paul Lalli
Guest
Posts: n/a
 
      09-11-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> i am trying to connect to remote machine using Perl..here is wht i have
> found..in the net
> use Net::SSH:erl;
> my $ssh = Net::SSH:erl->new($host);
> $ssh->login($user, $pass);
> my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
> when i give my hostname and other details, the compilation error i get
> is
> Can't locate Net/SSH/Perl.pm in @INC (@INC contains: c:/Perl/lib
> c:/Perl/site/li
> b .) at sshperl.pl line 1.
> BEGIN failed--compilation aborted at sshperl.pl line 1.
> whether i need to install any module for this


Yes, you do. Net::SSH:erl is not a built-in module. Use the ppm
program that came with your installation of ActivePerl to find it. If
it doesn't exist in a ppm repository, you'll have to build it using
CPAN. I strongly suggest in that case that you read:
perldoc perlmodinstall

Paul Lalli

 
Reply With Quote
 
Paul Lalli
Guest
Posts: n/a
 
      09-11-2006
Binod Pant wrote:
> In my ActiveState Perl installation, I see the directory
> C:\Perl\site\lib\URI
>
> which has the ssh.pm file.


I'm confused as to what you think URI::ssh has to do with
Net::SSH:erl

Paul Lalli

 
Reply With Quote
 
Paul Lalli
Guest
Posts: n/a
 
      09-11-2006
(E-Mail Removed) wrote:
> hi Binod
> thanks for ur quick reply, i have verified that and found that the flie
> ssh.pm does exist in the proper location..


URI::ssh has *nothing* to do with Net::SSH:erl.

> still i have to install the package?


Yes.

> if yes wht is the package name shall i give


The package you're trying to use is the package you need to install.
Net::SSH:erl

Paul Lalli

 
Reply With Quote
 
vish.chitnis@gmail.com
Guest
Posts: n/a
 
      09-12-2006
hi paul,

i get this error when i try to install the Net::SSH:erl package.. wht
else i need to do in order to install this package successfully

vish

nmake -- NOT OK
unning make test
Can't test without successful make
unning make install
make had returned bad status, install seems impossible

Paul Lalli wrote:
> (E-Mail Removed) wrote:
> > hi Binod
> > thanks for ur quick reply, i have verified that and found that the flie
> > ssh.pm does exist in the proper location..

>
> URI::ssh has *nothing* to do with Net::SSH:erl.
>
> > still i have to install the package?

>
> Yes.
>
> > if yes wht is the package name shall i give

>
> The package you're trying to use is the package you need to install.
> Net::SSH:erl
>
> Paul Lalli


 
Reply With Quote
 
Ch Lamprecht
Guest
Posts: n/a
 
      09-12-2006
(E-Mail Removed) wrote:
> hi paul,
>
> i get this error when i try to install the Net::SSH:erl package.. wht
> else i need to do in order to install this package successfully
>
> vish
>
> nmake -- NOT OK
> unning make test
> Can't test without successful make
> unning make install
> make had returned bad status, install seems impossible
>


Why don't you use ppm to install the package:

ppm

i net-ssh-perl

HTH, Christoph

--

perl -e "print scalar reverse q/(E-Mail Removed)/"
 
Reply With Quote
 
Paul Lalli
Guest
Posts: n/a
 
      09-12-2006
(E-Mail Removed) wrote:
> i get this error when i try to install the Net::SSH:erl package.. wht
> else i need to do in order to install this package successfully


> nmake -- NOT OK
> unning make test
> Can't test without successful make
> unning make install
> make had returned bad status, install seems impossible


Please stop top-posting. Post your replies BELOW what you are replying
to. Thank you.

First, I don't believe for a second that's the FULL error message.
What happened before the "NOT OK"?

Second, have you tried installing the package through ActiveState's
Perl Package Manager (ppm)? That's generally far easier for Windows
module installations.

Paul Lalli

 
Reply With Quote
 
vish.chitnis@gmail.com
Guest
Posts: n/a
 
      09-13-2006

Paul Lalli wrote:
> (E-Mail Removed) wrote:
> > i get this error when i try to install the Net::SSH:erl package.. wht
> > else i need to do in order to install this package successfully

>
> > nmake -- NOT OK
> > unning make test
> > Can't test without successful make
> > unning make install
> > make had returned bad status, install seems impossible

>
> Please stop top-posting. Post your replies BELOW what you are replying
> to. Thank you.
>
> First, I don't believe for a second that's the FULL error message.
> What happened before the "NOT OK"?
>
> Second, have you tried installing the package through ActiveState's
> Perl Package Manager (ppm)? That's generally far easier for Windows
> module installations.
>
> Paul Lalli




hi paul

thnx for ur suggestions..
now i have a query...i didnt understand when u said try installing thro
PPM...first how do i find tht PPM is installed in my machine or it gets
installed by default when you install the active perl on your
machine..i have active perl 8.xx installed on my machine

thanks
vish

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
python ssh and Tetia SSH server loial Python 0 02-10-2009 01:06 PM
Python ssh with SSH Tectia server loial Python 0 02-03-2009 03:38 PM
Using Python to run SSH commands on a remote server John Salerno Python 5 06-25-2008 06:57 AM
connect a database in remote server (can connect to the server via SSH) zhangxiaoyu912@gmail.com Perl Misc 2 07-18-2007 07:20 PM
SSH Module: Accessing CLI box using SSH and not getting the return output?? Deepika Perl Misc 2 11-14-2006 04:48 AM



Advertisments