linux Redhat5.8 升级 openSLL 无法升级成功,解决办法

最近公司一台服务器,扫描出openSLL 漏洞,需要升级ssl版本才能解决,但是升级了几次一直没升级成功,记录一下

Redhat5.8 的 默认ssl版本是0.9.8e 
查询资料,发现如果要升级高版本的ssl需要升级perl 

然后在网上找了一下升级perl的文档,安装时间比较久

注意在官网下载perl的时候,下载版本号最后一位为奇数的,不然有可能是开发版,强行安装有可能会造成系统奔溃

perl版本升级记录

注意:为了系统的稳定以及更好地管理,适当进行备份,一般遵循

  • 不先rm -rf
  • 先下载tar.gz 文件,然後手动 安装到/usr/local/bin/目录下
  • /usr/bin/perl 建立软连接到 /usr/local/bin/perl

1、安装

find / -name perl
#查询perl路径,确认相关
tar -zxvf perl-5.26.3.tar.gz
#解压压缩包
cd perl-5.26.3
#进入文件目录
./Configure -des -Dprefix=/usr/local/perl
#指定编译安装路径
make
make test
make install
#如出现cc错误,安装基础环境 yum -y install gcc
#如果这个过程没有错误的话,那么恭喜你安装完成了.

 

2、替换

##但是这只是安装完成了,并没有与系统契合,系统使用的还是旧版本
#so 干掉旧版本
mv /usr/bin/perl /usr/bin/perl.bak
#备份,程序员的日常
ln -s /usr/local/perl/bin/perl /usr/bin/perl
#建立新的软连接,使安装的perl生效

3、检测

#检测
perl
-v

This is perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-linux

Copyright 1987-2018, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

#成功

 

然后按照下面的步骤升级ssl

wget https://openssl.org/source/openssl-1.0.2t.tar.gz
tar -zxvf openssl-1.0.2t.tar.gz
cd openssl-1.0.2t
./config --prefix=/usr/local/openssl --openssldir=/etc/ssl --shared zlib
安装 测试 编译 
make
make test
make install
检查安装是否成功
openssl version -a

应该是没问题了的。

------------------------------------------------------------------

后面又碰到一台机器安装openssl没报错,但是openssl  version -a 版本就是不变,然后在网上找了一下

https://blog.csdn.net/yang_yulin_/article/details/99728500

按照这个升级成功了。

升级ssh时发现,明明已经升级了ssl但是还是会报

checking OpenSSL library version... configure: error: OpenSSL >= 1.0.1 required (have "0090802f (OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008)")

下面的资料帮我解决了这个问题,指定ssl路径

https://my.oschina.net/makouz/blog/731970

posted @ 2020-04-16 16:31  ljcxy  阅读(995)  评论(0编辑  收藏  举报