自学内容网 自学内容网

Linux-学习-05-openssl安装与卸载

目录

一、环境信息

二、卸载步骤

1、使用包管理器卸载

三、安装步骤

1、下载OpenSSL源代码

2、解压并进入目录

3、配置、编译和安装

4、更新软链接

5、更新共享库缓存

6、/etc/profile添加环境变量

7、环境变量生效

8、openSSL版本验证


一、环境信息

名称
CPUIntel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
操作系统CentOS Linux release 7.9.2009 (Core)
内存4G
逻辑核数4
原openssl版本OpenSSL 1.0.2k-fips  26 Jan 2017
新openssl版本OpenSSL 1.1.1w  11 Sep 2023

二、卸载步骤

1、使用包管理器卸载

[root@czg0 openssl-1.1.1w]# yum remove openssl

[root@czg0 openssl-1.1.1w]# yum remove openssl-devel

三、安装步骤

1、下载OpenSSL源代码

[root@czg0 GcdwPkg]# wget https://www.openssl.org/source/openssl-1.1.1w.tar.gz
--2024-06-22 18:59:56--  https://www.openssl.org/source/openssl-1.1.1w.tar.gz
正在解析主机 www.openssl.org (www.openssl.org)... 34.36.58.177, 2600:1901:0:1812::
正在连接 www.openssl.org (www.openssl.org)|34.36.58.177|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:9893384 (9.4M) [application/tar+gzip]
正在保存至: “openssl-1.1.1w.tar.gz”

100%[================================================================================================================================================>] 9,893,384   1.15MB/s 用时 9.5s   

2024-06-22 19:00:07 (1012 KB/s) - 已保存 “openssl-1.1.1w.tar.gz” [9893384/9893384])

2、解压并进入目录

[root@czg0 GcdwPkg]# tar -xvf openssl-1.1.1w.tar.gz

[root@czg0 GcdwPkg]# cd openssl-1.1.1w/

[root@czg0 openssl-1.1.1w]# ll
总用量 1016
-rw-rw-r--  1 root root     87 9月  11 2023 ACKNOWLEDGEMENTS
drwxrwxr-x  3 root root   4096 9月  11 2023 apps
-rw-rw-r--  1 root root    854 9月  11 2023 AUTHORS
-rw-rw-r--  1 root root   4099 9月  11 2023 build.info
-rw-rw-r--  1 root root 614956 9月  11 2023 CHANGES
-rwxrwxr-x  1 root root  28664 9月  11 2023 config
-rw-rw-r--  1 root root   2510 9月  11 2023 config.com
drwxrwxr-x  2 root root   4096 9月  11 2023 Configurations
-rwxrwxr-x  1 root root 130510 9月  11 2023 Configure
-rw-rw-r--  1 root root   3627 9月  11 2023 CONTRIBUTING
drwxrwxr-x 64 root root   4096 9月  11 2023 crypto
drwxrwxr-x  9 root root    108 9月  11 2023 demos
drwxrwxr-x  7 root root    161 9月  11 2023 doc
drwxrwxr-x  3 root root   4096 9月  11 2023 engines
-rw-rw-r--  1 root root  11055 9月  11 2023 e_os.h
drwxrwxr-x  3 root root     18 9月  11 2023 external
-rw-rw-r--  1 root root     84 9月  11 2023 FAQ
drwxrwxr-x  2 root root    326 9月  11 2023 fuzz
drwxrwxr-x  5 root root     51 9月  11 2023 include
-rw-rw-r--  1 root root  57824 9月  11 2023 INSTALL
-rw-rw-r--  1 root root   6121 9月  11 2023 LICENSE
drwxrwxr-x  2 root root    160 9月  11 2023 ms
-rw-rw-r--  1 root root  46932 9月  11 2023 NEWS
-rw-rw-r--  1 root root   4492 9月  11 2023 NOTES.ANDROID
-rw-rw-r--  1 root root   2093 9月  11 2023 NOTES.DJGPP
-rw-rw-r--  1 root root   4578 9月  11 2023 NOTES.PERL
-rw-rw-r--  1 root root   5532 9月  11 2023 NOTES.UNIX
-rw-rw-r--  1 root root   3861 9月  11 2023 NOTES.VMS
-rw-rw-r--  1 root root   7488 9月  11 2023 NOTES.WIN
drwxrwxr-x  2 root root     21 9月  11 2023 os-dep
-rw-rw-r--  1 root root   3158 9月  11 2023 README
-rw-rw-r--  1 root root  16069 9月  11 2023 README.ENGINE
-rw-rw-r--  1 root root     61 9月  11 2023 README.FIPS
drwxrwxr-x  4 root root   4096 9月  11 2023 ssl
drwxrwxr-x 11 root root   8192 9月  11 2023 test
drwxrwxr-x  2 root root     43 9月  11 2023 tools
drwxrwxr-x  3 root root   4096 9月  11 2023 util
drwxrwxr-x  2 root root    256 9月  11 2023 VMS
drwxrwxr-x  2 root root      6 9月  11 2023 wycheproof

3、配置、编译和安装

[root@czg0 openssl-1.1.1w]# ./config 
Operating system: x86_64-whatever-linux2
Configuring OpenSSL version 1.1.1w (0x1010117fL) for linux-x86_64
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL file first)         ***
***                                                                ***
**********************************************************************
[root@czg0 openssl-1.1.1w]# make
[root@czg0 openssl-1.1.1w]# make install

4、更新软链接

[root@czg0 openssl-1.1.1w]# ln -sf /usr/local/bin/openssl /usr/bin/openssl
[root@czg0 openssl-1.1.1w]# ln -sf /usr/local/include/openssl /usr/include/openssl
[root@czg0 openssl-1.1.1w]# ln -sf /usr/local/lib/libssl.so /usr/lib/libssl.so
[root@czg0 openssl-1.1.1w]# ln -sf /usr/local/lib/libcrypto.so /usr/lib/libcrypto.so

5、更新共享库缓存

[root@czg0 openssl-1.1.1w]# ldconfig

6、/etc/profile添加环境变量

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Pkg/GcdwPkg/openssl-1.1.1w

7、环境变量生效

[root@czg0 openssl-1.1.1w]# . /etc/profile

8、openSSL版本验证

[root@czg0 openssl-1.1.1w]# openssl version
OpenSSL 1.1.1w  11 Sep 2023


原文地址:https://blog.csdn.net/qq_45111959/article/details/139886729

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!