How to upgrade OpenSSL in CentOS 6.5 / Linux / Unix from source?

前端 未结 11 1374
刺人心
刺人心 2020-12-12 18:13

How do I upgrade OpenSSL in CentOS 6.5?

I have used these commands, but nothings happens:

 cd /usr/src
 wget http://www.openssl.org/source/openssl-1.         


        
相关标签:
11条回答
  • 2020-12-12 18:29
    ./config --prefix=/usr --openssldir=/usr/local/openssl shared
    

    Try this config line instead to overwrite the default. It installs to prefix /usr/local/ssl by default in your setup when you leave off the prefix. You probably have "/usr/local/ssl/bin/openssl" instead of overwriting /usr/bin/openssl. You can also use /usr/local for prefix instead, but you would need to adjust your path accordingly if that is not already on your path. Here is the INSTALL documentation:

      $ ./config
      $ make
      $ make test
      $ make install
    
     [If any of these steps fails, see section Installation in Detail below.]
    
    This will build and install OpenSSL in the default location, which is (for
    historical reasons) /usr/local/ssl. If you want to install it anywhere else,
    run config like this:
    
      $ ./config --prefix=/usr/local --openssldir=/usr/local/openssl
    

    https://github.com/openssl/openssl/blob/master/INSTALL http://heartbleed.com/

    0 讨论(0)
  • 2020-12-12 18:29

    I agree that in 95% of cases, all you need is sudo yum update openssl

    However, if you need a specific version of openssl or specific functionality, which is not in CentOS repository, you probably need to compile from source. The other answers here were incomplete. Below is what worked (CentOS 6.9), although this may introduce incompatibilities with installed software, and will not auto-update the openssl.


    Choose openssl version from https://www.openssl.org/source/

    • At the time of this writing July 1, 2017, the needed version was dated 2017-May-25 13:09:51, openssl-1.1.0f.tar.gz
    • Copy the desired link, and use below, in our case ( https://www.openssl.org/source/openssl-1.1.0f.tar.gz )

    Log-in as root:

    cd /usr/local/src/
    
    # OPTIONALLY CHANGE openssl-1.1.0f.tar.gz to the version which you want
    wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz
    
    sha256sum openssl-1.1.0f.tar.gz  #confirm this matches the published hash
    
    tar -zxf openssl-1.1.0f.tar.gz
    
    cd /usr/local/src/openssl-1.1.0f
    
    ./config --prefix=/usr/local --openssldir=/usr/local/openssl
    make
    make test
    make install
    
    export LD_LIBRARY_PATH=/usr/local/lib64
    
    #make export permanent
    echo "export LD_LIBRARY_PATH=/usr/local/lib64" > /etc/profile.d/ld_library_path.sh
    chmod ugo+x /etc/profile.d/ld_library_path.sh
    
    openssl version  #confirm it works
    
    #recommended reboot here
    
    openssl version  #confirm it works after reboot
    
    0 讨论(0)
  • 2020-12-12 18:29

    rpm -qa openssl yum clean all && yum update "openssl*" lsof -n | grep ssl | grep DEL cd /usr/src wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz tar -zxf openssl-1.0.1g.tar.gz cd openssl-1.0.1g ./config --prefix=/usr --openssldir=/usr/local/openssl shared ./config make make test make install cd /usr/src rm -rf openssl-1.0.1g.tar.gz rm -rf openssl-1.0.1g

    and

    openssl version
    
    0 讨论(0)
  • 2020-12-12 18:33

    You can also check the local changelog to verify whether or not OpenSSL is patched against the vulnerability with the following command:

    rpm -q --changelog openssl | grep CVE-2014-0224
    

    If a result is not returned, then you must patch OpenSSL.

    http://www.liquidweb.com/kb/update-and-patch-openssl-for-the-ccs-injection-vulnerability/

    0 讨论(0)
  • 2020-12-12 18:35

    My approach was:

    openssl version
    OpenSSL 1.0.1e 11 Feb 2013
    
    wget https://www.openssl.org/source/openssl-1.0.2a.tar.gz
    wget http://www.linuxfromscratch.org/patches/blfs/svn/openssl-1.0.2a-fix_parallel_build-1.patch
    tar xzf openssl-1.0.2a.tar.gz
    cd openssl-1.0.2a
    patch -Np1 -i ../openssl-1.0.2a-fix_parallel_build-1.patch
    ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib shared zlib-dynamic
    make
    make install
    
    openssl version
    OpenSSL 1.0.2a 19 Mar 2015 
    
    0 讨论(0)
  • 2020-12-12 18:40

    sudo yum update openssl is all you need.

    This will bring you up to openssl-1.0.1e-16.el6_5.7.

    You need to restart Apache after the update. Or better yet, reboot the box if possible, so that all applications that use OpenSSL will load the new version.

    0 讨论(0)
提交回复
热议问题