构建OpenSSH时缺少OpenSSL头文件

nam*_*ame 5 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 ***
Run Code Online (Sandbox Code Playgroud)

openSSH的配置脚本中是否有错误或者我是否需要更改任何命令?

Ann*_*zer 5

这是一种不发送标志的方法./configure您需要先安装OpenSSL.在这里获取最新的tarball .

./config
make
make test
make install
Run Code Online (Sandbox Code Playgroud)

然后安装libssl-dev

apt-get install libssl-dev
Run Code Online (Sandbox Code Playgroud)

然后你可以重试安装OpenSSH:

cd openssh-[version]
./configure
make
make install
Run Code Online (Sandbox Code Playgroud)


jww*_*jww 0

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
Run Code Online (Sandbox Code Playgroud)

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
...
Run Code Online (Sandbox Code Playgroud)

I think you should use:

cd openssl-1.0.1l
./config --openssldir=/tmp/ssh/openssl
...
Run Code Online (Sandbox Code Playgroud)

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


在 中使用 OpenSSL /tmp/ssh/openssl,则:

cd openssh-6.7p1
./configure --with-ssl-dir=/tmp/ssh/openssl --prefix=/tmp/ssh
...
Run Code Online (Sandbox Code Playgroud)

使用非系统提供的 OpenSSL 可能会造成麻烦。那么您可能还想查看使用 RPATH 构建 OpenSSL?。您可能还想使用 RPATH 构建 OpenSSH。