I want to build a certain OpenSSH version with a specific OpenSSL version from sources, but I get the following error:

mkdir /tmp/ssh
cp openssh-6.7p1.tar.gz /tmp/ssh
cp openssl-1.0.1l.tar.gz /tmp/ssh
cd /tmp/ssh
tar zxvf openssl-1.0.1l.tar.gz
cd openssl-1.0.1l
./config --prefix=/tmp/ssh
make
make install
cd ..
tar zxvf openssh-6.7p1.tar.gz
cd openssh-6.7p1
./configure --with-ssl-dir=/tmp/ssh --prefix=/tmp/ssh

...
checking openssl/opensslv.h usability... no
checking openssl/opensslv.h presence... no
checking for openssl/opensslv.h... no
configure: error: *** OpenSSL headers missing - please install first or check config.log ***

Is there a bug in openSSH's configure script or do I have to change any command?

share|improve this question

Here's a way without sending flats to ./configure You need to install OpenSSL first. Get the latest tarball here.

./config
make
make test
make install

Then install libssl-dev

apt-get install libssl-dev

Then you can retry installing OpenSSH:

cd openssh-[version]
./configure
make
make install
share|improve this answer

ftp://ftp.ca.openbsd.org/pub/OpenBSD/OpenSSH/portable/INSTALL says:

LibreSSL/OpenSSL should be compiled as a position-independent library (i.e. with -fPIC) otherwise OpenSSH will not be able to link with it. If you must use a non-position-independent libcrypto, then you may need to configure OpenSSH --without-pie.

The following commands do not result in the "OpenSSL headers missing" error anymore:

tar zxvf openssl-1.0.1l.tar.gz
cd openssl-1.0.1l
./config --prefix=/tmp/ssh
make
make install
cd ..
tar zxvf openssh-6.7p1.tar.gz
cd openssh-6.7p1
./configure --with-ssl-dir=/tmp/ssh --prefix=/tmp/ssh --without-pie
share|improve this answer
1  
Alternatively it is possible to use "./config --prefix=/tmp/ssh shared" and "LD_LIBRARY_PATH=/tmp/ssh/lib ./configure --prefix=/tmp/ssh --with-ssl-dir=/tmp/ssh". – name May 19 '15 at 23:45
    
Setting LD_LIBRARY_PATH worked for me. – iaav Aug 10 '17 at 16:23

Is there a bug in openSSH's configure script or do I have to change any command?

According to Installing OpenSSL and OpenSSH:

If 'configure' can't find ssl, change the configure command to:

./configure --prefix=/usr --with-ssl-dir=/usr/local/ssl --with-tcp-wrappers

The above means the OpenSSL headers are located at /usr/local/ssl/include and the libraries are located at /usr/local/ssl/lib. I think you need to change the path to /tmp/ssh.


From:

cd openssl-1.0.1l
./config --prefix=/tmp/ssh
...

I think you should use:

cd openssl-1.0.1l
./config --openssldir=/tmp/ssh/openssl
...

Also see Compilation and Installation on the OpenSSL wiki. You might want to use other options, like enable-ec_nistp_64_gcc_128.


With OpenSSL in /tmp/ssh/openssl, then:

cd openssh-6.7p1
./configure --with-ssl-dir=/tmp/ssh/openssl --prefix=/tmp/ssh
...

Using the non-system provided OpenSSL can cause trouble. So you might also want to check out Build OpenSSL with RPATH?. You might also want to build OpenSSH with RPATHs too.

share|improve this answer
    
Changing "./config --prefix=/tmp/ssh" to "./config --openssldir=/tmp/ssh/openssl" and changing "./configure --with-ssl-dir=/tmp/ssh --prefix=/tmp/ssh" to "./configure --with-ssl-dir=/tmp/ssh/openssl --prefix=/tmp/ssh" results in the same "OpenSSL headers missing" error. – name May 19 '15 at 21:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.