traveler has asked for the wisdom of the Perl Monks concerning the following question:

I need to have a program under Win32 access another host using SSH. There is a CPAN module for Net::SSH, but it requires a command-line ssh, not the putty I normally use (different args). I looked for Net::SSH::W32Perl, but could not find a CPAN repository with a copy -- I do not have a compiler on this host.

I saw a similar question dated 2001, but I was wondering if there was a solution, now?

thanks, --traveler

Replies are listed 'Best First'.
Re: Win32 SSH solution?
by Limbic~Region (Chancellor) on Mar 16, 2004 at 23:19 UTC
    traveler,
    Have you looked at http://www.openssh.org? It provides command line binaries such as ssh, scp, sftp, etc. I checked crazyinsomniac's repositories for an AS ppd but there wasn't one. You may ask him if the first suggestion doesn't work.

    Cheers - L~R

    Update: Found one!

    c:\perl> ppm ppm> rep add "winnipeg" http://theoryx5.uwinnipeg.ca/ppms/ ppm> install SSH::Perl::W32Perl
      There hasn't been a need for Net::SSH::W32Perl for a while now. Math::PARI is available from several ppm repositories (as are the various Digest/Crypt modules), and it's all you need for ssh2 support (what you get with Net::SSH::W32Perl)

      On a sidenote, for ssh1 you need Math::GMP, which is available from my repository but requires cygwin (dlls provided of course).

      Now it does appear someone went and ported gmp to windows, so I'll see about getting a clean (doesn't require cygwin) version of Math::GMP to my repository.

      update: Would you look at what I found, Math-GMP for Win32 Perl, it's no ppm repository, but just as good.

      I finally got gladman's version to compile, but something goes wrong with nasm and memory access violation this, that ... but the kalinabears libgmp works fine, so I might put that up on my repository (we'll see)...update and I have.

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

        Thanks PodMaster. I initially tried Net::SSH::Perl, but I could not find that either. So I added some repositiories and found it. I added Math::Pari and Crypt::DH, but when I finally get around to run it (using SSH2), it cannot find F_SETFL in ActiveState 2.8. So then I looked at where it uses it and it is trying to set the socket to nonblocking. Bummer.

        Then I loaded ::W32Perl per Limbic~Region's suggestion. Then it asked me to install Net::SSH::Perl::Key::DSA. I went to do that, but ppm could not find it. So I tried SSH1. It could not find Math::GMP, even with PodMaster's repository.

        Ideas?

Re: Win32 SSH solution?
by halley (Prior) on Mar 17, 2004 at 17:17 UTC
    The cygwin project offers an openssh tool suite for Win32, including ssh, scp, ssh-keygen, etc., which should be straightforward for you to use as-is.

    --
    [ e d @ h a l l e y . c c ]

Re: Win32 SSH solution?
by iburrell (Chaplain) on Mar 17, 2004 at 20:12 UTC
    PuTTY includes plink, a command-line ssh client. I don't know if Net::SSH could be persuaded to use plink instead of ssh. There is a global variable that holds the command name. I would worry about some of process control is different enough that IPC::Open2 doesn't work right.
    $Net::SSH::ssh = "c:\Program Files\PuTTY\plink";
Re: Win32 SSH solution?
by Anonymous Monk on Mar 24, 2004 at 22:37 UTC
    This is how I got them to work on Win32... Install the Net-SSH-W32Perl from: http://www.soulcage.net/ppds. specify ### use Net::SSH::Perl; # comment out use Net::SSH::W32Perl; # wrapper for SSH::Perl $ssh = Net::SSH::W32Perl->new($host); # note the W32 part ! install any missing modules from same source !! PPM install http://www.soulcage.net/ppds/PPDS.58/Math-Pari.ppd install http://www.soulcage.net/ppds/PPDS.58/Crypt-DH.ppd etc...
Re: Win32 SSH solution?
by Anonymous Monk on Mar 24, 2004 at 22:38 UTC
    This is how I got them to work on Win32... <code> Install the Net-SSH-W32Perl from: http://www.soulcage.net/ppds. specify ### use Net::SSH::Perl; # comment out use Net::SSH::W32Perl; # wrapper for SSH::Perl $ssh = Net::SSH::W32Perl->new($host); # note the W32 part ! install any missing modules from same source !! PPM install http://www.soulcage.net/ppds/PPDS.58/Math-Pari.ppd install http://www.soulcage.net/ppds/PPDS.58/Crypt-DH.ppd etc... <code>