Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Perl (NET::SSH2 on Windows)

  • 18-05-2008 4:55pm
    #1
    Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭


    Hi There,

    Before I go crazy, has anyone actually got SSH to work on a Windows Platform?

    I've tried Net::SSH::Perl and Net::SSH::W32Perl modules but they were a nightmare with all the dependencies on all the Math Modules which seem impossible to install? - so I tried Net::SSH2.

    With this you must have OpenSSL installed which I have no problem, and libssl. Problem with libssl is I must compile it - having difficulty there and seems to be no compiled binary version anywhere!

    I'm about to give up getting SSH working via Perl - I need to remotely log into a machine and run a command. I was thinking maybe doing it in something else such as C and then just calling this from the Perl script and retrieving the result from the command executed on the machine.

    Just wondering if anyone has any ideas? - this is horrible!


Comments

  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    Ok I discovered the problem and I'll give the solution.

    You must use ActiveState Perl Version 5.8 - ActivePerl-5.8.8.822-MSWin32-x86-280952.msi (I had the latest version) Once you have this done you must then use ppm to install the modules. Don't do it manually.

    cmd>ppm install http://theoryx5.uwinnipeg.ca/ppms/Net-SSH-W32Perl.ppd

    This will give you all the dependencies such as Math::GMP / Pari / All the Crypto stuff etc. These can all be installed from that site.

    I've finally got everything working.
     use Net::SSH::W32Perl;
     $ENV{HOME} = "C:/";
     my $host = 'localhost';
     my $ssh = new Net::SSH::W32Perl($host);
     print $ssh->login('administrator', '');
    

    Havn't done much with regards to commands and retrieving the output etc but I can see this being incredibly useful.

    Hope this helps others.


  • Closed Accounts Posts: 1,444 ✭✭✭Cantab.


    Webmonkey wrote: »
    Hi There,

    Before I go crazy, has anyone actually got SSH to work on a Windows Platform?

    I've tried Net::SSH::Perl and Net::SSH::W32Perl modules but they were a nightmare with all the dependencies on all the Math Modules which seem impossible to install? - so I tried Net::SSH2.

    With this you must have OpenSSL installed which I have no problem, and libssl. Problem with libssl is I must compile it - having difficulty there and seems to be no compiled binary version anywhere!

    I'm about to give up getting SSH working via Perl - I need to remotely log into a machine and run a command. I was thinking maybe doing it in something else such as C and then just calling this from the Perl script and retrieving the result from the command executed on the machine.

    Just wondering if anyone has any ideas? - this is horrible!

    I've not much experience with Perl modules on Windows...

    I imagine it's a straightforward case of general module installation? (But as we all know with Perl, 1-2% of the time, the installation can be a bit hariy)

    What errors are you getting?

    Have you set your PERL5LIB path correctly? You need to point to the ./blib/lib directory (sometimes you also need to point to the directory containing relevant .so files)


  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    ^ Just after sorting the problem in my 2nd post :) - Cheers anyways.


Advertisement