搜尋
首頁運維CentOSCentOS如何升級Bash(修復破殼漏洞)

下面由centos教學專欄跟大家介紹CentOS 升級 Bash --- 修復破殼漏洞 ,希望對需要的朋友有幫助!

CentOS如何升級Bash(修復破殼漏洞)

因為很多公司都有自己的yum 來源,所以直接配置其他的yum 源升級的話是不允許的,為了能方便的升級,並且安全的測試,先拿一台測試機做測試。

CentOS 的修復方案

安裝yum 外掛yum-downloadonly

註:yum-downloadonly 外掛程式的作用是實作只下載所需套件而不直接安裝

sudo yum -y install yum-downloadonly

新增CentOS  的官方來源CentOS-Base.repo

CentOS 5 的官方來源

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#released updates 
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#CentOS 6 的官方來源

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#released updates 
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

下載最新的bash 套件

把最新版本的bash 的rpm 套件下載到/tmp 目錄

sudo  yum -y install --downloadonly --downloaddir=/tmp/ bash

下載後的套件名稱分別如下:

CentOS 5

bash-3.2-33.el5_10.4.x86_64.rpm

CentOS 6##

bash-4.1.2-15.el6_5.2.x86_64.rpm
安裝最新的bash 套件

CentOS 5

sudo yum -y install bash-3.2-33.el5_10.4.x86_64.rpm

CentOS 6

sudo yum -y install bash-4.1.2-15.el6_5.2.x86_64.rpm
驗證

# env X='() { (a)=>\' sh -c "echo date"; cat echo  輸出如下:

date
Mon Sep 29 10:11:56 CST 2014

env VAR='() { :; }; echo Bash is vulnerable!' bash -c "echo Bash Hello"  輸出如下:

Bash Hello
證明修復成功

加入現有的rpm 來源

最後一步就是把測試完成的套件加入公司自己的來源中,然後全網推送了。

以上是CentOS如何升級Bash(修復破殼漏洞)的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述
本文轉載於:segmentfault。如有侵權,請聯絡admin@php.cn刪除
Centos之後發生的事情:前方的道路Centos之後發生的事情:前方的道路Apr 16, 2025 am 12:07 AM

CentOS的替代方案包括RockyLinux、AlmaLinux、OracleLinux和SLES。 1)RockyLinux和AlmaLinux提供與RHEL兼容的二進制包和長期支持。 2)OracleLinux提供企業級支持和Ksplice技術。 3)SLES提供長期支持和穩定性,但商業許可可能增加成本。

Centos:探索替代方案Centos:探索替代方案Apr 15, 2025 am 12:03 AM

CentOS的替代方案包括UbuntuServer、Debian、Fedora、RockyLinux和AlmaLinux。 1)UbuntuServer適合基本操作,如更新軟件包和配置網絡。 2)Debian適用於高級用法,如使用LXC管理容器。 3)RockyLinux可通過調整內核參數優化性能。

centos關機命令行centos關機命令行Apr 14, 2025 pm 09:12 PM

CentOS 關機命令為 shutdown,語法為 shutdown [選項] 時間 [信息]。選項包括:-h 立即停止系統;-P 關機後關電源;-r 重新啟動;-t 等待時間。時間可指定為立即 (now)、分鐘數 ( minutes) 或特定時間 (hh:mm)。可添加信息在系統消息中顯示。

centos和ubuntu的區別centos和ubuntu的區別Apr 14, 2025 pm 09:09 PM

CentOS 和 Ubuntu 的關鍵差異在於:起源(CentOS 源自 Red Hat,面向企業;Ubuntu 源自 Debian,面向個人)、包管理(CentOS 使用 yum,注重穩定;Ubuntu 使用 apt,更新頻率高)、支持週期(CentOS 提供 10 年支持,Ubuntu 提供 5 年 LTS 支持)、社區支持(CentOS 側重穩定,Ubuntu 提供廣泛教程和文檔)、用途(CentOS 偏向服務器,Ubuntu 適用於服務器和桌面),其他差異包括安裝精簡度(CentOS 精

centos配置ip地址centos配置ip地址Apr 14, 2025 pm 09:06 PM

CentOS 中配置 IP 地址的步驟:查看當前網絡配置:ip addr編輯網絡配置文件:sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0更改 IP 地址:編輯 IPADDR= 行更改子網掩碼和網關(可選):編輯 NETMASK= 和 GATEWAY= 行重啟網絡服務:sudo systemctl restart network驗證 IP 地址:ip addr

centos如何安裝centos如何安裝Apr 14, 2025 pm 09:03 PM

CentOS 安裝步驟:下載 ISO 映像並刻錄可引導媒體;啟動並選擇安裝源;選擇語言和鍵盤佈局;配置網絡;分區硬盤;設置系統時鐘;創建 root 用戶;選擇軟件包;開始安裝;安裝完成後重啟並從硬盤啟動。

centos8重啟sshcentos8重啟sshApr 14, 2025 pm 09:00 PM

重啟 SSH 服務的命令為:systemctl restart sshd。步驟詳解:1. 訪問終端並連接到服務器;2. 輸入命令:systemctl restart sshd;3. 驗證服務狀態:systemctl status sshd。

centos8怎麼重啟網絡centos8怎麼重啟網絡Apr 14, 2025 pm 08:57 PM

在 CentOS 8 中重啟網絡需執行以下步驟:停止網絡服務(NetworkManager)重新加載網絡模塊(r8169)啟動網絡服務(NetworkManager)檢查網絡狀態(通過 ping 8.8.8.8)

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
4 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
4 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您聽不到任何人,如何修復音頻
4 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.聊天命令以及如何使用它們
4 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

DVWA

DVWA

Damn Vulnerable Web App (DVWA) 是一個PHP/MySQL的Web應用程序,非常容易受到攻擊。它的主要目標是成為安全專業人員在合法環境中測試自己的技能和工具的輔助工具,幫助Web開發人員更好地理解保護網路應用程式的過程,並幫助教師/學生在課堂環境中教授/學習Web應用程式安全性。 DVWA的目標是透過簡單直接的介面練習一些最常見的Web漏洞,難度各不相同。請注意,該軟體中

VSCode Windows 64位元 下載

VSCode Windows 64位元 下載

微軟推出的免費、功能強大的一款IDE編輯器

SublimeText3 Linux新版

SublimeText3 Linux新版

SublimeText3 Linux最新版

Atom編輯器mac版下載

Atom編輯器mac版下載

最受歡迎的的開源編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用