i need to ssh to remote server using Perl

Discussion in 'Perl Misc' started by vish.chitnis@gmail.com, Sep 11, 2006.

  1. Guest

    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
     
    , Sep 11, 2006
    #1
    1. Advertising

  2. Binod Pant Guest

    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.

    <> wrote in message
    news:...
    >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
    >
     
    Binod Pant, Sep 11, 2006
    #2
    1. Advertising

  3. Guest

    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.
    >
    > <> wrote in message
    > news:...
    > >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
    > >
     
    , Sep 11, 2006
    #3
  4. Paul Lalli Guest

    wrote:
    > 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
     
    Paul Lalli, Sep 11, 2006
    #4
  5. Paul Lalli Guest

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

    Paul Lalli
     
    Paul Lalli, Sep 11, 2006
    #5
  6. Paul Lalli Guest

    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::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
     
    Paul Lalli, Sep 11, 2006
    #6
  7. Guest

    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

    Paul Lalli wrote:
    > 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::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
     
    , Sep 12, 2006
    #7
  8. Ch Lamprecht Guest

    wrote:
    > 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

    --

    perl -e "print scalar reverse q//"
     
    Ch Lamprecht, Sep 12, 2006
    #8
  9. Paul Lalli Guest

    wrote:
    > 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
     
    Paul Lalli, Sep 12, 2006
    #9
  10. Guest

    Paul Lalli wrote:
    > wrote:
    > > 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




    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
     
    , Sep 13, 2006
    #10
  11. Guest

    Ch Lamprecht wrote:
    > wrote:
    > > 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
    >
    > --
    >
    > perl -e "print scalar reverse q//"


    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
     
    , Sep 13, 2006
    #11
  12. Guest

    wrote:
    > Paul Lalli wrote:
    > > wrote:
    > > > 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

    >
    >
    >
    > 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
     
    , Sep 13, 2006
    #12
  13. Ch Lamprecht Guest

    wrote:
    > Ch Lamprecht wrote:
    >
    >> wrote:
    >>
    >>>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:



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


    type

    help rep

    from the ppm-prompt to find out, how to add repositories.
    Then add the following address to the list:

    http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58

    HTH, Christoph



    --

    perl -e "print scalar reverse q//"
     
    Ch Lamprecht, Sep 13, 2006
    #13
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Salerno
    Replies:
    5
    Views:
    1,088
    Taygun Kekec
    Jun 25, 2008
  2. loial
    Replies:
    0
    Views:
    441
    loial
    Feb 3, 2009
  3. loial
    Replies:
    0
    Views:
    427
    loial
    Feb 10, 2009
  4. Deepika
    Replies:
    2
    Views:
    239
    Deepika
    Nov 14, 2006
  5. Replies:
    2
    Views:
    326
Loading...

Share This Page