in reply to Need Help Installing Net::SSH2

You'll need to download and manually install libssh2. After make install, run /sbin/ldconfig /usr/local/lib, then install Net::SSH2. Fedora rpms have the nasty habit of not doing ldconfig correctly. I use Fedora, but I installed libssh2 from a Debian tarball and ran ldconfig. Worked.

Replies are listed 'Best First'.
Re^2: Need Help Installing Net::SSH2
by DanielSpaniel (Scribe) on Aug 29, 2011 at 15:54 UTC

    Hi Khen1950fx, Thx for the suggestion, I am trying it now, but not too familiar (yet) with installing as you suggest. I've manually downloaded a recent version of libssh2; unzipped it, untarred it and stuck it into a local directory. Now I have a directory with the following in it:

    config.guess  configure  INSTALL     LICENSE      mkinstalldirs  src  win32    config.sub    include    install-sh  Makefile.in  README   ssh2_sample.c

    I have run ./configure, and it ran through a bunch of stuff, but ultimately didn't seem to like something, and gave up with the following message:

    checking for OpenSSL... configure: error: Cannot find OpenSSL's <evp.h> or <hmac.h>

    Can you help me go from here please? I really appreciate your help.

      Go into the directory that you untarred the src to and type:
      ./configure --help
      A list of all the different options will popup. I would recommend doing:
      ./configure --enable-shared --with-gnu-ld
      The "--with-gnu-ld" is necessary in order to properly do ldconfig. So the mantra is:
      ./configure --enable-shared --with-gnu-ld make make check make install /sbin/ldconfig /usr/local/lib
      Now run
      whereis libssh2
      If everything's in order, then it should return something like:
      /usr/local/lib/libssh2.so /usr/local/lib/libssh2.a /usr/local/lib/libssh2.la
      Update: I think that you have the same problem with OpenSSL. Here's the most recent tarball:

      http://www.openssl.org/source/openssl-1.0.0d.tar.gz

      It's a slightly more complicated procedure. First, you need to remove the current openssl include headers. Then do
      ./Configure linux-elf -march=pentium make make test make install
      Next, you must manually install Net::SSH2.
      export LD_LIBRARY_PATH=/usr/local/lib perl Makefile.PL lib=/usr/local/lib make make test make install
      Now, you're good to go...
        Hi Khen1950fx,

        Sorry, only just saw your reply. Okay, I will give this a whirl. Without reading your entire post I dived straight in and tried the ./configure bit (and got the "configure: error: Cannot find OpenSSL's <evp.h> or <hmac.h>") ... Then I saw your comment further down about downloading and installing OpenSSL again ... so I'm trying that now. Download seems to have messed up at the moment, so I'll try again in a while ... Meantime I am trying to locate the current openssl include headers, which currently escape me.

        Thank you again for your help, and if I don't get back here tonight, then I hope I can bother you again tomorrow if you're able to. Thanks!

        Hi Khen1950x, Finally got back onto this project again for a while ... You said that I should "... First, you need to remove the current openssl include headers." However, I am a bit lost as to know where to locate them, in order to remove them. I guess it may be different on different systems, but if you're able to make some suggestions then that would be very useful to me. Meantime, I have now downloaded both the libssh2 and openssl tarballs and extracted. I tried doing the libssh2 stuff you suggested, before having done anything else, and it errored with:

        "checking for OpenSSL... configure: error: Cannot find OpenSSL's <evp.h> or <hmac.h>"

        So, I figured I needed to do the openssl stuff first. But, before doing that I wanted to make sure that I had removed the files you suggested ... and that's where I am right now. Any assistance mightily appreciated. I think this might take me a while to do, since I'm on a bit of a learning curve here, but hope you can be patient :-) Thanks again.

        cd /root/.cpan/build/Net-SSH2-0.53-AjnE2p/ export LD_LIBRARY_PATH=/usr/local/lib/ perl Makefile.PL lib=/usr/local/lib make make install perl -MCPAN -e shell cpan[1]> install Net::SSH2 Reading '/root/.cpan/Metadata' Database was generated on Wed, 30 Apr 2014 10:53:02 GMT Net::SSH2 is up to date (0.53).
        Thanks - this worked