2015-05-19 48 views
3

時丟失我想建立與源特定的OpenSSL版本有一定的OpenSSH版本,但我得到了以下錯誤:OpenSSL的頭建設的OpenSSH

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 *** 

有OpenSSH中的配置腳本錯誤還是我必須改變任何命令?

回答

0

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

根據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 

裝置OpenSSL的報頭分別位於/usr/local/ssl/include和庫位於/usr/local/ssl/lib。我認爲你需要改變路徑到/tmp/ssh


來源:

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

我認爲你應該使用:

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

另見Compilation and Installation在OpenSSL的維基。您可能想要使用其他選項,如enable-ec_nistp_64_gcc_128


隨着OpenSSL的在/tmp/ssh/openssl,則:

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

使用提供的OpenSSL非系統可引起麻煩。所以你可能也想看看Build OpenSSL with RPATH?。你也可能想用RPATH構建OpenSSH。

+0

更改 「./config中前綴=/tmp目錄/ SSH」 到」 ./config中--openssldir =/tmp/ssh/openssl「並將」./configure --with-ssl-dir =/tmp/ssh --prefix =/tmp/ssh「更改爲」./configure --with-ssl-dir =/tmp/ssh/openssl --prefix =/tmp/ssh「導致相同的」OpenSSL頭文件丟失「錯誤。 – name

1

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

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.

下面的命令不會導致「OpenSSL的頭失蹤」的錯誤了:

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 
+1

或者可以使用「./config --prefix =/tmp/ssh shared」和「LD_LIBRARY_PATH =/tmp/ssh/lib ./configure --prefix =/tmp/ssh --with-ssl-dir =的/ tmp/SSH」。 – name

+0

設置LD_LIBRARY_PATH爲我工作。 – iaav

3

這裏的而不發送單位,以./configure的方式,您需要安裝OpenSSL的第一。獲取最新的tarball here

./config 
make 
make test 
make install 

然後install libssl-dev

apt-get install libssl-dev 

然後你就可以重試installing OpenSSH:

cd openssh-[version] 
./configure 
make 
make install