Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenSSL headers missing when building OpenSSH

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?

like image 424
name Avatar asked May 19 '15 16:05

name


2 Answers

Here's a way without sending flags 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
like image 119
Ann Kilzer Avatar answered Oct 16 '22 13:10

Ann Kilzer


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
like image 38
name Avatar answered Oct 16 '22 11:10

name