i need to ssh to remote server using Perl

V

vish.chitnis

i am trying to connect to remote machine using Perl..here is wht i have
found..in the net
use Net::SSH::perl;
my $ssh = Net::SSH::perl->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
 
B

Binod Pant

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
cpan> install packagename

that's it!

HTH
Binod.
 
V

vish.chitnis

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
 
P

Paul Lalli

i am trying to connect to remote machine using Perl..here is wht i have
found..in the net
use Net::SSH::perl;
my $ssh = Net::SSH::perl->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::perl 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
 
P

Paul Lalli

Binod said:
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::perl

Paul Lalli
 
P

Paul Lalli

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::perl.
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::perl

Paul Lalli
 
V

vish.chitnis

hi paul,

i get this error when i try to install the Net::SSH::perl 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
 
C

Ch Lamprecht

hi paul,

i get this error when i try to install the Net::SSH::perl 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
 
P

Paul Lalli

i get this error when i try to install the Net::SSH::perl 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
 
V

vish.chitnis

Paul said:
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
 
V

vish.chitnis

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

ppm

i net-ssh-perl

HTH, Christoph

ok.i found that PPM is there in /perl/bin its ms-dos batch file which
after run gives me the ppm command prompt..now when i issue the above
command
i net-ssh-perl to install this package, i get package not found
error..so how do i go abt it..i can download the package the( it will
be .gz file i guess) so after i download this file wht files shall i
extract and where do i paste them under perl directory..can i know the
location for this package..

thanks
vish
 
V

vish.chitnis

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


ok.i found that PPM is there in /perl/bin its ms-dos batch file which
after run gives me the ppm command prompt..now when i issue the above
command
i net-ssh-perl to install this package, i get package not found
error..so how do i go abt it..i can download the package from the net (
it will be .gz file i guess) so after i download this file wht files
shall i extract and where do i paste them under perl directory..can i
know the location for this package..i.e net::ssh::perl

thanks
vish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top