1

我正在将更新版本的 openssh 安装到 ubuntu 服务器上(罕见 13.04)

我已经设定 export 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 
--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

任何人有任何进一步的想法吗?

4

1 回答 1

1

解决方案非常简单。很多人都面临这个问题,所以我想分享我是如何解决它的,希望它能帮助那里的人,尤其是“心脏出血虫”的问题。如果你有这个试图编译 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.

解决方案:

  1. 找到 openssl tarball 并重建它,如下所示。

    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
    
  2. 重新编译openssh

    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
    
  3. 验证安装并重新启动 sshd 守护进程

    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再重新登录。

于 2014-04-16T13:21:37.333 回答