2
wget http://mirror.internode.on.net/pub/OpenBSD/OpenSSH/portable/openssh-7.4p1.tar.gz  
wget https://www.openssl.org/source/openssl-1.0.2j.tar.gz

I have tried at least three configurations to install openssl-1.0.2j:

./config

./config --prefix=/usr/local --openssldir=/usr/local/openssl

./config -Wl, -rpath=/usr/local/ssl/lib

After make, make install, it looks like the installation was successful:
It also shows the correct version:
Root @ ebd: /usr/local/src/openssh-7.4p1# openssl version -a
OpenSSL 1.0.2j 26 Sep 2016
Built on: reproducible build, date unspecified
Platform: linux-x86_64
...

But when I installe openssh-7.4p1, I got an error:

checking whether snprintf correctly terminates long strings... yes
checking whether vsnprintf returns correct values on overflow... yes
checking whether snprintf can declare const char *fmt... yes
checking whether system supports SO_PEERCRED getsockopt... yes
checking for (overly) strict mkstemp... yes
checking if openpty correctly handles controlling tty... yes
checking whether AI_NUMERICSERV is declared... yes
checking whether getpgrp requires zero arguments... yes
checking OpenSSL header version... 100020af (OpenSSL 1.0.2j  26 Sep 2016)
checking OpenSSL library version... 1000106f (OpenSSL 1.0.1f 6 Jan 2014)
checking whether OpenSSL's headers match the library... no
configure: error: Your OpenSSL headers do not match your
    library. Check config.log for details.
    If you are sure your installation is consistent, you can disable the check
    by running "./configure --without-openssl-header-check".
    Also see contrib/findssl.sh for help identifying header/library mismatches.

I follow the below to install openssh-7.4p1:

tar xf openssh-7.4p1.tar.gz
cd openssh-7.4p1/
./configure --prefix=/opt/openssh-7.4p1 --with-md5-passwords
make && make install

I know that there is a parameter can be used: -with-ssl-dir = PATH.

But I do not want to use it, I would like to know how to add openssl header files and library files to the system environment variables.


The following is the most recently updated message.
I use the following to install the openssh just now.

cd openssh-7.4p1/
CFLAGS="-I /usr/local/openssl/include -L /usr/local/openssl/lib -Wl,-rpath=/usr/local/openssl/lib" ./configure --prefix=/opt/openssh-7.4p1 --with-md5-passwords
make
make install

I get a error.

root@srv13:~/openssh-7.4p1# /opt/openssh-7.4p1/bin/ssh -V
/opt/openssh-7.4p1/bin/ssh: /usr/local/openssl/lib/libcrypto.so.1.0.0: no version information available (required by /opt/openssh-7.4p1/bin/ssh)
/opt/openssh-7.4p1/bin/ssh: /usr/local/openssl/lib/libcrypto.so.1.0.0: no version information available (required by /opt/openssh-7.4p1/bin/ssh)

enter image description here

root@srv13:~/openssl-1.0.2j# which openssl
/usr/bin/openssl
root@srv13:~/openssl-1.0.2j# ls -ld /usr/bin/openssl
lrwxrwxrwx 1 root root 30 Jan  5 21:54 /usr/bin/openssl -> /usr/local/openssl/bin/openssl
root@srv13:~/openssl-1.0.2j# 
root@srv13:~/openssl-1.0.2j# ldd /usr/local/openssl/bin/openssl 
    linux-vdso.so.1 =>  (0x00007ffcf997f000)
    libssl.so.1.0.0 => /usr/local/openssl/lib/libssl.so.1.0.0 (0x00007f1850994000)
    libcrypto.so.1.0.0 => /usr/local/openssl/lib/libcrypto.so.1.0.0 (0x00007f1850544000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f185017f000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f184ff7b000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f1850c04000)
    root@srv13:~/openssl-1.0.2j# ls /usr/local/openssl/lib/libcrypto.so.1.0.0 -ld
    -r-xr-xr-x 1 root root 2690206 Jan  5 21:51 /usr/local/openssl/lib/libcrypto.so.1.0.0

root@srv13:~/openssl-1.0.2j# ldd /opt/openssh-7.4p1/bin/ssh
/opt/openssh-7.4p1/bin/ssh: /usr/local/openssl/lib/libcrypto.so.1.0.0: no version information available (required by /opt/openssh-7.4p1/bin/ssh)
/opt/openssh-7.4p1/bin/ssh: /usr/local/openssl/lib/libcrypto.so.1.0.0: no version information available (required by /opt/openssh-7.4p1/bin/ssh)
    linux-vdso.so.1 =>  (0x00007fff0dbf2000)
    libcrypto.so.1.0.0 => /usr/local/openssl/lib/libcrypto.so.1.0.0 (0x00007f57ba287000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f57ba083000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f57b9e6a000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f57b9c4f000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f57b988a000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f57ba993000)
Wei Yu
  • 97
  • 3
  • 12
  • You should show your configure line for OpenSSH. The best I can tell, you only provided the configure line for OpenSSL. You can use either (1) a RPATH so runtime linking works as expected (`-Wl,-rpath=/usr/local/ssl/lib`), or (2) use static linking to sidestep the runtime linker problems. Also checkout this on SuperUser: [Building OpenSSH for OS X?](http://superuser.com/a/961422/173513). It updates OpenSSL on OS X, and then it updates OpenSSH using the updated OpenSSL. It also uses static linking to avoid those sorts of problems. – jww Jan 05 '17 at 06:11
  • I have already pasted the configuration for openssh. I have seen the article you gave. you can see I try a RPATH,but it failed. – Wei Yu Jan 05 '17 at 06:54
  • For OpenSSH, you might try `CFLAGS="-I /usr/local/ssl/include -L /usr/local/ssl/lib -Wl,-rpath=/usr/local/ssl/lib" ./configure --prefix=/opt/openssh-7.4p1 --with-md5-passwords`. I don't recall if OpenSSH respects `CFLAGS` during configure. You can verify the RPATH with `ldd`. It will show loading of `libcrypto` from `/usr/local/ssl/lib` rather than `/usr/lib`. – jww Jan 05 '17 at 15:52
  • Hi,please see my updated content. I get a new error. – Wei Yu Jan 05 '17 at 16:51
  • Where, exactly, is `libcrypto.so`? Please provide an `ls` of where you believe it to be. And what does `ldd` have to say about OpenSSH? Please run `ldd` and provide the exact output. No pictures, please. – jww Jan 05 '17 at 16:57
  • The libcrypto.so is under /usr/local/openssl/lib/. – Wei Yu Jan 05 '17 at 17:20
  • Checkout [What does the “no version information available” error from linux dynamic linker mean?](http://stackoverflow.com/q/137773). The problem appears to be with OpenSSH. And here's the ubuntu duplicate: [libcrypto.so.1.0.0: no version information available (required by ssh)](http://askubuntu.com/q/830466). Also see [openssh "no version information available"](https://www.google.com/search?q=openssh+"no+version+information+available"). – jww Jan 05 '17 at 18:20

0 Answers0