Ubuntu OpenSSH升级库与标头不匹配
我正在ubuntu服务器上安装更新版本的openssh(raring 13.04) 我已经设置了导出LDFLAGS=“-I/usr/lib-I/usr/local/lib” 当运行我的Ubuntu OpenSSH升级库与标头不匹配,ubuntu,configure,openssh,ldflags,Ubuntu,Configure,Openssh,Ldflags,我正在ubuntu服务器上安装更新版本的openssh(raring 13.04) 我已经设置了导出LDFLAGS=“-I/usr/lib-I/usr/local/lib” 当运行我的/configure语句时 ./configure --prefix=/usr --exec_prefix=/usr --libexecdir=/usr/lib/openssh --sysconfdir=/etc/ssh --datadir=/usr/share/sshd --with-md5-passwords
/configure
语句时
./configure --prefix=/usr --exec_prefix=/usr --libexecdir=/usr/lib/openssh
--sysconfdir=/etc/ssh --datadir=/usr/share/sshd --with-md5-passwords
--with-privsep-path=/var/lib/sshd
输出结束:
.....
checking OpenSSL header version... 1000105f (OpenSSL 1.0.1e 11 Feb 2013)
checking OpenSSL library version... 1000103f (OpenSSL 1.0.1c 10 May 2012)
checking whether OpenSSL's headers match the library... no
configure: error: Your OpenSSL headers do not match your
library. Check config.log for details.
我尝试了一个建议将LDFLAGS更改为
export LDFLAGS=“-L/usr/lib/libssl.so-/usr/lib/libcrypto.so”
强制使用一个图书馆
但是当我运行./configure命令时
.........
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/usr/local/sas/openssh-6.2p2':
configure: error: C compiler cannot create executables
See `config.log' for more details
有人有进一步的想法吗?解决办法很简单。很多人都面临这个问题,所以我想分享一下我是如何解决这个问题的,希望它能帮助其他人,特别是在“心脏出血”的问题上。例如,如果您在编译openssl时遇到以下问题:
checking OpenSSL header version... 1000107f (OpenSSL 1.0.1g 7 Apr 2014)
checking OpenSSL library version... 9080ef (OpenSSL 0.9.8y 5 Feb 2013)
checking whether OpenSSL's headers match the library... no
configure: error: Your OpenSSL headers do not match your
library.
解决方案:
tar xvfz /usr/src/openssl-1.0.1g.tar.gz (IF YOU DID THIS BEFORE GO TO NEXT STEP)
cd /usr/src/openssl-1.0.1g/
./config –prefix=/usr/local –openssldir=/usr/local/openssl shared
make clean
make
make test
make install
openssl version
echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
ldconfig –v
tar xvfz /usr/src/openssh-6.6p1.tar.gz (IF YOU DID THIS BEFORE GO TO NEXT STEP)
cd /usr/src/openssh-6.6p1/
./configure
make
make install
ssh –V
OpenSSH_6.6p1, OpenSSL 1.0.1g 7 Apr 2014 (this should be your display)
/etc/rc.d/rc.sshd restart
您可能需要注销ssh会话并重新登录,然后再次执行
ssh-V
。解决方案非常简单。很多人都面临这个问题,所以我想分享一下我是如何解决这个问题的,希望它能帮助其他人,特别是在“心脏出血”的问题上。例如,如果您在编译openssl时遇到以下问题:
checking OpenSSL header version... 1000107f (OpenSSL 1.0.1g 7 Apr 2014)
checking OpenSSL library version... 9080ef (OpenSSL 0.9.8y 5 Feb 2013)
checking whether OpenSSL's headers match the library... no
configure: error: Your OpenSSL headers do not match your
library.
解决方案:
tar xvfz /usr/src/openssl-1.0.1g.tar.gz (IF YOU DID THIS BEFORE GO TO NEXT STEP)
cd /usr/src/openssl-1.0.1g/
./config –prefix=/usr/local –openssldir=/usr/local/openssl shared
make clean
make
make test
make install
openssl version
echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
ldconfig –v
tar xvfz /usr/src/openssh-6.6p1.tar.gz (IF YOU DID THIS BEFORE GO TO NEXT STEP)
cd /usr/src/openssh-6.6p1/
./configure
make
make install
ssh –V
OpenSSH_6.6p1, OpenSSL 1.0.1g 7 Apr 2014 (this should be your display)
/etc/rc.d/rc.sshd restart
您可能必须退出ssh会话并重新登录,然后再次执行
ssh-V
。-I
应该进入CFLAGS
,而不是LDFLAGS
,链接器不使用include
语句,因此当它开始链接时,更改include路径为时已晚export-LDFLAGS=“-L/usr/lib/libssl.so-/usr/lib/libcrypto.so”
也有点混乱,应该是简单的export LDFLAGS=“-L/usr/lib”
因为-L
只是编译器查找库的路径,而不是实际库的绝对路径。谢谢-我尝试了几种LDFLAGS语句,包括“-L/usr/lib”你注意到的是另一个网站上有相同问题的另一个人,它为他们工作——但不是为机械工程师工作——我尝试了几种不同的LDFLAGS语句,包括“-L/usr/lib”您注意到的是另一个网站上有相同问题的另一个人,它为他们工作-但对于CFLAGS我不这样认为,我认为是CPPLFAGS,所以我尝试了各种CPPFLAGS=stations,单独使用LDFLAGS,包括CPPFLAGS=“-I/usr/include”和CPPFLAGS=“-I/usr/include-I/usr/local/include”我已经尝试了以下我认为是你的建议CFLAGS=“-I/usr/include”当这不起作用时CFLAGS=“-I/usr/include-I/usr/local/include”任何想法-I
都应该放在CFLAGS
中,而不是放在LDFLAGS
中,链接器不使用include
语句,因此当它开始链接时,更改include路径为时已晚export-LDFLAGS=“-L/usr/lib/libssl.so-/usr/lib/libcrypto.so”
也有点混乱,应该是简单的export LDFLAGS=“-L/usr/lib”
因为-L
只是编译器查找库的路径,而不是实际库的绝对路径。谢谢-我尝试了几种LDFLAGS语句,包括“-L/usr/lib”你注意到的是另一个网站上有相同问题的另一个人,它为他们工作——但不是为机械工程师工作——我尝试了几种不同的LDFLAGS语句,包括“-L/usr/lib”您注意到的是另一个网站上有相同问题的另一个人,它为他们工作-但对于CFLAGS我不这样认为,我认为是CPPLFAGS,所以我尝试了各种CPPFLAGS=stations,单独使用LDFLAGS,包括CPPFLAGS=“-I/usr/include”和CPPFLAGS=“-I/usr/include-I/usr/local/include”我已经尝试了以下我认为是你的建议CFLAGS=“-I/usr/include”,当这不起作用时CFLAGS=“-I/usr/include-I/usr/local/include”有什么想法吗