搜尋
首頁運維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 php怎么安装opcachecentos php怎么安装opcacheJan 19, 2023 am 09:50 AM

centos php安装opcache的方法:1、执行“yum list php73* | grep opcache”命令;2、通过“yum install php73-php-opcache.x86_64”安装opcache;3、使用“find / -name opcache.so”查找“opcache.so”的位置并将其移动到php的扩展目录即可。

在 Windows 上运行 shell 脚本文件的不同方法在 Windows 上运行 shell 脚本文件的不同方法Apr 13, 2023 am 11:58 AM

适用于 Linux 的 Windows 子系统第一种选择是使用适用于 Linux 或 WSL 的 Windows 子系统,这是一个兼容层,用于在 Windows 系统上本地运行 Linux 二进制可执行文件。它适用于大多数场景,允许您在 Windows 11/10 中运行 shell 脚本。WSL 不会自动可用,因此您必须通过 Windows 设备的开发人员设置启用它。您可以通过转到设置 > 更新和安全 > 对于开发人员来完成。切换到开发人员模式并通过选择是确认提示。接下来,查找 W

centos 7安装不出现界面怎么办centos 7安装不出现界面怎么办Jan 03, 2023 pm 05:33 PM

centos7安装不出现界面的解决办法:1、选择“Install CentOS 7”,按“e”进入启动引导界面;2、 将“inst.stage2=hd:LABEL=CentOS\x207\x20x86_64”改为“linux dd”;3、重新进入“Install CentOS 7”,按“e”将“hd:”后的字符替换成“/dev/sdd4”,然后按“Ctrl+x”执行即可。

centos中ls命令不显示颜色怎么办centos中ls命令不显示颜色怎么办Apr 20, 2022 pm 03:16 PM

方法:1、利用“vim ~/.bashrc”编辑用户目录(~)下的“.bashrc”文件;2、在文件内添加“alias ls="ls --color"”;3、利用“:wq!”命令保存文件内的更改;4、“exit”命令退出终端后重新连接即可。

五个鲜为人知的现代 Bash 脚本编写技术五个鲜为人知的现代 Bash 脚本编写技术Jun 26, 2023 pm 08:36 PM

程序员经常使用Bash命令语言创建Shell脚本来自动化手动任务。例如,他们会为各种配置、文件操作、生成构建结果和各种与DevOps相关的活动创建Bash脚本。几乎所有类Unix或基于Unix的操作系统都为用户提供预安装的Bash解释器,因此我们可以使用Bash编写更具可移植性的自动化脚本。正如我们已经知道的那样,Bash脚本编写是指使用Bash命令语言的语法、内置Bash命令和核心操作系统CLI程序(如GNU核心工具)编写一系列命令。标准且老式的Bash脚本通常执行一些命令并在终端上显示纯文本

centos6.5支持uefi吗centos6.5支持uefi吗Apr 26, 2022 pm 04:11 PM

centos6.5支持ueif方式。ueif方式安装方法:1、设置BIOS为禁用CSM,禁用安全启动;2、使用Diskgen将硬盘格式化为GPT格式;3、下载系统并通过光盘安装,将ESP分区建立挂在“/boot/efi”上即可。

步骤详解Centos中编译安装php8与配置方法步骤详解Centos中编译安装php8与配置方法Feb 03, 2023 pm 02:59 PM

本篇文章给大家带来了关于php的相关知识,其中主要介绍了在Centos系统中是如何编译安装php,以及如何正确配置的,步骤很详细!感兴趣的朋友下面一起来看一下吧,希望对大家有帮助。

centos怎么部署php环境centos怎么部署php环境Oct 25, 2022 am 09:33 AM

centos部署php环境的方法:1、通过“yum install”命令安装扩展;2、使用“wget http://php.net/distributions/php-7.1.0.tar.gz”命令解压php;3、通过“make && make install”命令进行编译安装;4、在安装成功后,配置环境变量;5、启动“php-fpm”即可。

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.能量晶體解釋及其做什麼(黃色晶體)
2 週前By尊渡假赌尊渡假赌尊渡假赌
倉庫:如何復興隊友
4 週前By尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
4 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser是一個安全的瀏覽器環境,安全地進行線上考試。該軟體將任何電腦變成一個安全的工作站。它控制對任何實用工具的訪問,並防止學生使用未經授權的資源。

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

強大的PHP整合開發環境

SublimeText3 英文版

SublimeText3 英文版

推薦:為Win版本,支援程式碼提示!

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具