最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

linux環(huán)境openssl、openssh升級(jí)流程

 更新時(shí)間:2025年03月04日 15:51:19   作者:MRR、皮皮蝦  
該文章詳細(xì)介紹了在Ubuntu 22.04系統(tǒng)上升級(jí)OpenSSL和OpenSSH的方法,首先,升級(jí)OpenSSL的步驟包括下載最新版本、安裝編譯環(huán)境、備份和安裝、驗(yàn)證等,然后,升級(jí)OpenSSH的步驟包括下載最新版本、安裝相關(guān)依賴、解壓和編譯安裝、查看版本、備份替換文件、重啟服務(wù)等

linux常因openssl、openssh漏洞進(jìn)行升級(jí)。

本文以u(píng)buntu22.04為例,對(duì)openssl、openssh進(jìn)行升級(jí)。

一.升級(jí)openssl

1.官網(wǎng)下載最新版openssl

wget https://www.openssl.org/source/openssl-3.0.15.tar.gz

如果因網(wǎng)絡(luò)原因下載不動(dòng),可以直接訪問官網(wǎng),下載最新版本:

https://www.openssl.org/source/

root@localhost:~# wget https://www.openssl.org/source/openssl-3.0.15.tar.gz
--2024-07-19 07:31:28--  https://www.openssl.org/source/openssl-3.0.15.tar.gz
Resolving www.openssl.org (www.openssl.org)... 34.36.58.177, 2600:1901:0:1812::
Connecting to www.openssl.org (www.openssl.org)|34.36.58.177|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://github.com:443/openssl/openssl/releases/download/openssl-3.0.15/openssl-3.0.15.tar.gz [following]
--2024-07-19 07:31:29--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/7634677/6ac36897-7f0a-4dc5-8d1c-3d8b0eab4f5d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20240719%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240719T073129Z&X-Amz-Expires=300&X-Amz-Signature=658f52e12bd883cbda4f7abcbac2508a5642bccc70baf8d159b4e39a31623702&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=7634677&response-content-disposition=attachment%3B%20filename%3Dopenssl-3.0.15.tar.gz&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.109.133
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15305497 (15M) [application/octet-stream]
Saving to: ‘openssl-3.0.15.tar.gz'

openssl-3.0.15.tar.gz                  100%[===========================================================================>]  14.60M  81.0KB/s    in 4m 17s  

2024-07-19 07:35:48 (58.1 KB/s) - ‘openssl-3.0.15.tar.gz' saved [15305497/15305497]

2.安裝編譯環(huán)境

apt-get install -y build-essential
root@localhost:/opt/openssl-3.0.15# apt-get install -y build-essential
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  bzip2 cpp cpp-11 dpkg-dev fakeroot fontconfig-config fonts-dejavu-core g++ g++-11 gcc gcc-11 gcc-11-base libalgorithm-diff-perl
  libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan6 libatomic1 libc-dev-bin libc-devtools libc6-dev libcc1-0 libcrypt-dev libdeflate0
  libdpkg-perl libfakeroot libfile-fcntllock-perl libfontconfig1 libgcc-11-dev libgd3 libgomp1 libisl23 libitm1 libjbig0 libjpeg-turbo8 libjpeg8 liblsan0
  libmpc3 libnsl-dev libquadmath0 libstdc++-11-dev libtiff5 libtirpc-dev libtsan0 libubsan1 libwebp7 libxpm4 linux-libc-dev lto-disabled-list make
  manpages-dev rpcsvc-proto
Suggested packages:
  bzip2-doc cpp-doc gcc-11-locales debian-keyring g++-multilib g++-11-multilib gcc-11-doc gcc-multilib autoconf automake libtool flex bison gdb gcc-doc
  gcc-11-multilib glibc-doc bzr libgd-tools libstdc++-11-doc make-doc

如果系統(tǒng)為CentOS,則執(zhí)行

yum install perl-IPC-Cmd perl-Data-Dumper gcc gcc-c++ perl perl-devel -y

3.下載后解壓安裝

tar -xf openssl-3.0.15.tar.gz -C /opt/

進(jìn)入目錄

cd /opt/openssl-3.0.15

編譯配置openssl安裝目錄

./config --prefix=/usr/local/openssl
root@localhost:~# tar -xf openssl-3.0.15.tar.gz -C /opt/
root@localhost:~# cd /opt/openssl-3.0.15/
root@localhost:/opt/openssl-3.0.15# ./config --prefix=/usr/local/openssl
Configuring OpenSSL version 3.0.15 for target linux-x86_64
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile
Created include/openssl/configuration.h

**********************************************************************
***                                                                ***
***   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.md file first)      ***
***                                                                ***
**********************************************************************

安裝

make && make install
root@localhost:/opt/openssl-3.0.15# make && make install
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/crypto/bn_conf.h.in > include/crypto/bn_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/crypto/dso_conf.h.in > include/crypto/dso_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/asn1.h.in > include/openssl/asn1.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/asn1t.h.in > include/openssl/asn1t.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/bio.h.in > include/openssl/bio.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/cmp.h.in > include/openssl/cmp.h

4.備份更新openssl

備份openssl

mv /usr/bin/openssl /usr/bin/openssl_bak

復(fù)制openssl文件到/usr/bin/下

cp /usr/local/openssl/bin/openssl /usr/bin/

添加動(dòng)態(tài)鏈接庫數(shù)據(jù)

echo ‘/usr/local/openssl/lib64/' >> /etc/ld.so.conf

更新動(dòng)態(tài)鏈接庫

ldconfig
root@localhost:/opt/openssl-3.0.15# mv /usr/bin/openssl /usr/bin/openssl_bak
root@localhost:/opt/openssl-3.0.15# cp /usr/local/openssl/bin/openssl  /usr/bin/
root@localhost:/opt/openssl-3.0.15# echo "/usr/local/openssl/lib64/" >> /etc/ld.so.conf
root@localhost:/opt/openssl-3.0.15# ldconfig

5.進(jìn)行驗(yàn)證

openssl version
root@localhost:/usr/local/openssl/lib64# openssl version
OpenSSL 3.0.15 3 Sep 2024 (Library: OpenSSL 3.0.15 3 Sep 2024)

若出現(xiàn)如下問題

root@localhost:/opt/openssl-3.0.15# openssl version
openssl: /lib/x86_64-linux-gnu/libcrypto.so.3: version `OPENSSL_3.0.9' not found (required by openssl)

備份libcrypto.so.3文件后,復(fù)制安裝目錄下lib64/libcrypto.so.3到/lib/x86_64-linux-gnu/目錄

root@localhost:/opt/openssl-3.0.15# cd /usr/local/openssl/lib64/
root@localhost:/usr/local/openssl/lib64# ll
total 16636
drwxr-xr-x 5 root root    4096 Jul 19 07:49 ./
drwxr-xr-x 7 root root    4096 Jul 19 07:50 ../
drwxr-xr-x 2 root root    4096 Jul 19 07:49 engines-3/
-rw-r--r-- 1 root root 9541222 Jul 19 07:49 libcrypto.a
lrwxrwxrwx 1 root root      14 Jul 19 07:49 libcrypto.so -> libcrypto.so.3*
-rwxr-xr-x 1 root root 5383824 Jul 19 07:49 libcrypto.so.3*
-rw-r--r-- 1 root root 1268762 Jul 19 07:49 libssl.a
lrwxrwxrwx 1 root root      11 Jul 19 07:49 libssl.so -> libssl.so.3*
-rwxr-xr-x 1 root root  813928 Jul 19 07:49 libssl.so.3*
drwxr-xr-x 2 root root    4096 Jul 19 07:49 ossl-modules/
drwxr-xr-x 2 root root    4096 Jul 19 07:49 pkgconfig/

root@localhost:/usr/local/openssl/lib64# mv /lib/x86_64-linux-gnu/libcrypto.so.3 /root/
root@localhost:/usr/local/openssl/lib64# cp libcrypto.so.3 /lib/x86_64-linux-gnu/
root@localhost:/usr/local/openssl/lib64# openssl version
OpenSSL 3.0.15 3 Sep 2024 (Library: OpenSSL 3.0.15 3 Sep 2024)

二、升級(jí)openssh

1.下載最新版openssh

wget
https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.9p1.tar.gz

如因網(wǎng)絡(luò)原因下載不動(dòng),可以直接訪問 ,下載最新版本https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable

2.安裝相關(guān)依賴

apt-get install -y zlib1g-dev libpam0g-dev
root@localhost:~#  apt-get install -y  zlib1g-dev libpam0g-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  libpam0g-dev zlib1g-dev
0 upgraded, 2 newly installed, 0 to remove and 67 not upgraded.
Need to get 281 kB of archives.
After this operation, 1,010 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libpam0g-dev amd64 1.4.0-11ubuntu2.4 [117 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 zlib1g-dev amd64 1:1.2.11.dfsg-2ubuntu9.2 [164 kB]
Fetched 281 kB in 2s (142 kB/s)

系統(tǒng)為CentOS,則執(zhí)行

yum install zlib-devel pam-devel -y

3.解壓安裝

tar xf openssh-9.9p1.tar.gz -C /opt/
cd /opt/openssh-9.9p1

配置安裝目錄

./configure --prefix=/usr/local/openssh
–with-ssl-dir=/usr/local/openssl --sysconfdir=/etc/ssh --with-pam --with-gssapi --with-rsa --with-rhosts-allowed --with-zlib --with-md5-passwords

編譯安裝

make && make install

4.查看目錄版本

/usr/local/openssh/bin/ssh -V
root@localhost:/usr/local/openssh# ./bin/ssh -V
OpenSSH_9.9p1, OpenSSL 3.0.15 3 Sep 2024

5.備份替換相關(guān)文件

mv /usr/sbin/sshd /usr/sbin/sshd_bak
mv /usr/bin/ssh /usr/bin/ssh_bak
mv /usr/bin/ssh-keygen /usr/bin/ssh-keygen_bak
cp -rf /usr/local/openssh/sbin/sshd /usr/sbin/sshd
cp -rf /usr/local/openssh/bin/ssh /usr/bin/ssh
cp -rf /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen

6.重啟ssh服務(wù)

systemctl restart sshd
root@localhost:/usr/local/openssh# systemctl restart sshd.service 
root@localhost:/usr/local/openssh# ssh -V
OpenSSH_9.9p1, OpenSSL 3.0.15 3 Sep 2024

執(zhí)行ssh服務(wù)狀態(tài)查詢命令

systemctl status sshd.service

查看發(fā)現(xiàn)文件的權(quán)限設(shè)置過于寬松

Permissions 0640 for'/etc/ssh/*****.key' are too open.

執(zhí)行chmod -R 600 /etc/ssh限制權(quán)限后重啟ssh服務(wù)

systemctl restart sshd

總結(jié)

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • Linux下如何實(shí)現(xiàn)創(chuàng)建/刪除軟連接

    Linux下如何實(shí)現(xiàn)創(chuàng)建/刪除軟連接

    這篇文章主要介紹了Linux下如何實(shí)現(xiàn)創(chuàng)建/刪除軟連接方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-07-07
  • linux下vsftpd的安裝及配置使用詳細(xì)步驟(推薦)

    linux下vsftpd的安裝及配置使用詳細(xì)步驟(推薦)

    這篇文章主要介紹了linux下vsftpd的安裝及配置使用詳細(xì)步驟 ,需要的朋友可以參考下
    2018-01-01
  • /etc/security/limits.conf詳解與配置過程

    /etc/security/limits.conf詳解與配置過程

    在Linux系統(tǒng)中,通過/etc/security/limits.conf文件和/etc/security/limits.d/目錄下的配置文件,可以設(shè)置用戶或用戶組的資源限制,配置文件中的soft和hard限制分別代表警告級(jí)別和硬性限制,它們需要匹配才能生效
    2024-10-10
  • 詳解centos7上elastic search安裝及填坑記

    詳解centos7上elastic search安裝及填坑記

    本篇文章主要介紹了centos7上elastic search安裝及填坑記,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-01-01
  • linux中的編譯驅(qū)動(dòng)到內(nèi)核方式

    linux中的編譯驅(qū)動(dòng)到內(nèi)核方式

    這篇文章主要介紹了linux中的編譯驅(qū)動(dòng)到內(nèi)核方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2025-09-09
  • Linux正確刪除軟鏈接方式

    Linux正確刪除軟鏈接方式

    在Linux上刪除軟鏈接時(shí),只刪除軟鏈接而不要?jiǎng)h除源文件,最推薦的做法是使用`rm`命令,其次的做法是使用`unlink`命令,不建議使用`rm-rf`命令,因?yàn)樗鼤?huì)誤刪源文件
    2026-01-01
  • Linux之信號(hào)的保存方式

    Linux之信號(hào)的保存方式

    這篇文章主要介紹了Linux之信號(hào)的保存方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-02-02
  • CentOS7環(huán)境中DHCP配置教程

    CentOS7環(huán)境中DHCP配置教程

    大家好,本篇文章主要講的是CentOS7環(huán)境中DHCP配置教程,感興趣的同學(xué)趕快來看一看吧,對(duì)你有幫助的話記得收藏一下,方便下次瀏覽
    2021-11-11
  • 關(guān)于linux下core dump【總結(jié)】

    關(guān)于linux下core dump【總結(jié)】

    下面小編就為大家?guī)硪黄P(guān)于linux下core dump【總結(jié)】。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-01-01
  • Linux實(shí)現(xiàn)安裝和配置lxqt桌面

    Linux實(shí)現(xiàn)安裝和配置lxqt桌面

    LXQt是輕量級(jí)Linux桌面環(huán)境,適合低配置電腦,安裝簡(jiǎn)單,選擇會(huì)話即可啟用,通過配置中心可自定義默認(rèn)程序、壁紙、電源管理及分辨率,并支持任務(wù)欄組件調(diào)整
    2025-09-09

最新評(píng)論

泰顺县| 车险| 石渠县| 乌兰察布市| 黑山县| 中方县| 连山| 繁昌县| 霍城县| 深泽县| 贺兰县| 邵武市| 莲花县| 浮梁县| 曲阜市| 中江县| 梁山县| 清水县| 会泽县| 柯坪县| 东乡族自治县| 铜陵市| 汾西县| 乡城县| 故城县| 株洲县| 响水县| 屏东市| 景洪市| 龙南县| 大港区| 昌邑市| 罗甸县| 宝丰县| 江阴市| 巴里| 华蓥市| 阿巴嘎旗| 汨罗市| 新平| 河源市|