IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    HeartBleed Ubuntu 修复问题记录

    longhao (longtask@gmail.com)发表于 2015-07-21 11:42:30
    love 0

        在安装某linux软件的时候,提示我们的服务器上的openssl是有漏洞的版本,需要重新安装一下。到linuxe服务器上查看一下:

    
    dpkg -l | grep "openssl”
    openssl                                  1.0.1f-1ubuntu2.8                amd64
    

        1.0.1f 是HeartBleed的版本之一,需要修复问题。

         1:卸载旧版本的openssl

    
    apt-get purge openssl
    rm -rf /etc/ssl
    

         2:安装新版本的openssl

         安装版本

    
    wget https://www.openssl.org/source/openssl-1.0.2d.tar.gz 
    tar zxvf openssl-1.0.2d.tar.gz
    ./config  --prefix=/usr/local --openssldir=/usr/local/ssl
    make && make install
    ./config shared --prefix=/usr/local --openssldir=/usr/local/ssl
    make clean
    make && make install
    

        链接openssl

    
    ln -sf /usr/local/bin/openssl `which openssl`
    

        查看openssl版本

    
    openssl version
    

        安装openssl之后,有些以前编译的软件会出现无法使用的情况,报错为:/usr/local/lib/libssl.so.1.0.0: no version information available 需要重新编译一下。

        

         3:OR 打patch的方式来处理

        patch地址:https://launchpad.net/ubuntu/+source/openssl/1.0.1-4ubuntu5.12

    
    wget http://www.openssl.org/source/openssl-1.0.1f.tar.gz
    tar -xvf openssl-1.0.1f.tar.gz
    wget https://launchpad.net/ubuntu/+archive/primary/+files/openssl_1.0.1f-1ubuntu1.debian.tar.gz
    tar -xvf openssl_1.0.1f-1ubuntu1.debian.tar.gz
    mv debian openssl_1.0.1f-1ubuntu1
    cd openssl-1.0.1f/
    patch -p1 < ../openssl_1.0.1f-1ubuntu1/patches/version-script.patch
    ./config
    make
    make test
    sudo make install
    

        

        参考文档:

    • [x] How to patch the Heartbleed bug (CVE-2014-0160) in OpenSSL?
    • [x] Linux 从源码编译安装 OpenSSL
    • [x] http://heartbleed.com


沪ICP备19023445号-2号
友情链接