构建OpenSSH时缺少OpenSSL头

构建OpenSSH时缺少OpenSSL头,openssl,openssh,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 o

我想从源代码中使用特定的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的配置脚本中是否存在错误,或者我是否必须更改任何命令

openSSH的配置脚本中是否存在错误,或者我是否必须更改任何命令

根据:

如果“configure”找不到ssl,请将configure命令更改为:

./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 --openssldir=/tmp/ssh/openssl
...
另请参见OpenSSL wiki上的。您可能需要使用其他选项,如
enable-ec\u nistp\u 64\u gcc\u 128


使用
/tmp/ssh/OpenSSL
中的OpenSSL,然后:

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

使用非系统提供的OpenSSL可能会导致问题。所以你可能也想去看看。您可能还希望使用rpath构建OpenSSH。

说:

LibreSSL/OpenSSL应编译为独立于位置的库 (即使用-fPIC)否则OpenSSH将无法与其链接。 如果必须使用非位置独立的libcrypto,则可能需要 配置OpenSSH——不带饼图

以下命令不再导致“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

这里有一种不向
/configure
发送标志的方法,您需要先安装OpenSSL。获取最新的tarball

然后

然后您可以重试


以下是此OpenSSL标头丢失错误的解决方案

git clone https://github.com/openssl/openssl.git
cd openssl
./Configure
make
make install

现在将安装OpenSSL,您将不再收到缺少消息的OpenSSL头。

将“/config--prefix=/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标头丢失”错误。或者,可以使用“/config--prefix=/tmp/ssh shared”和“LD_LIBRARY\u PATH=/tmp/ssh/lib./configure--prefix=/tmp/ssh--ssl dir=/tmp/ssh”“。我按照您的代码执行,
/configure
成功,无论是否使用
——不使用饼图。但是在
make
过程中发现:
cipher.h:69:17:error:field'evp'具有不完整的类型evp\u cipher\u CTX evp;^Makefile:152:recipe for target'ssh_api.o'失败
我就是找不到问题所在。你能帮我做这个吗?我的目的是安装openssh服务器,其中有一个非sudo prvilege用户,我的GPU服务器就是这样,我想启用SSH和SFTP,这样我就可以在Jetbrains Pycharm中将服务器用作SSH远程解释器。
./config
make
make test
make install
apt-get install libssl-dev
cd openssh-[version]
./configure
make
make install
git clone https://github.com/openssl/openssl.git
cd openssl
./Configure
make
make install