目录
CentOS 的修复方案
安装 yum 插件 yum-downloadonly
添加 CentOS  的官方源 CentOS-Base.repo
下载最新的 bash 包
安装最新的 bash 包
验证
加入现有的 rpm 源
首页 运维 CentOS CentOS如何升级Bash(修复破壳漏洞)

CentOS如何升级Bash(修复破壳漏洞)

Mar 01, 2021 pm 04:01 PM
bash centos

下面由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中文网其他相关文章!

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热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无尽的。

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

怎样优化CentOS HDFS配置 怎样优化CentOS HDFS配置 Apr 14, 2025 pm 07:15 PM

提升CentOS上HDFS性能:全方位优化指南优化CentOS上的HDFS(Hadoop分布式文件系统)需要综合考虑硬件、系统配置和网络设置等多个方面。本文提供一系列优化策略,助您提升HDFS性能。一、硬件升级与选型资源扩容:尽可能增加服务器的CPU、内存和存储容量。高性能硬件:采用高性能网卡和交换机,提升网络吞吐量。二、系统配置精调内核参数调整:修改/etc/sysctl.conf文件,优化TCP连接数、文件句柄数和内存管理等内核参数。例如,调整TCP连接状态和缓冲区大小

Centos停止维护2024 Centos停止维护2024 Apr 14, 2025 pm 08:39 PM

CentOS将于2024年停止维护,原因是其上游发行版RHEL 8已停止维护。该停更将影响CentOS 8系统,使其无法继续接收更新。用户应规划迁移,建议选项包括CentOS Stream、AlmaLinux和Rocky Linux,以保持系统安全和稳定。

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 HDFS配置 如何检查CentOS HDFS配置 Apr 14, 2025 pm 07:21 PM

检查CentOS系统中HDFS配置的完整指南本文将指导您如何有效地检查CentOS系统上HDFS的配置和运行状态。以下步骤将帮助您全面了解HDFS的设置和运行情况。验证Hadoop环境变量:首先,确认Hadoop环境变量已正确设置。在终端执行以下命令,验证Hadoop是否已正确安装并配置:hadoopversion检查HDFS配置文件:HDFS的核心配置文件位于/etc/hadoop/conf/目录下,其中core-site.xml和hdfs-site.xml至关重要。使用

CentOS上GitLab的备份方法有哪些 CentOS上GitLab的备份方法有哪些 Apr 14, 2025 pm 05:33 PM

CentOS系统下GitLab的备份与恢复策略为了保障数据安全和可恢复性,CentOS上的GitLab提供了多种备份方法。本文将详细介绍几种常见的备份方法、配置参数以及恢复流程,帮助您建立完善的GitLab备份与恢复策略。一、手动备份利用gitlab-rakegitlab:backup:create命令即可执行手动备份。此命令会备份GitLab仓库、数据库、用户、用户组、密钥和权限等关键信息。默认备份文件存储于/var/opt/gitlab/backups目录,您可通过修改/etc/gitlab

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

HDFS配置CentOS需要修改哪些文件 HDFS配置CentOS需要修改哪些文件 Apr 14, 2025 pm 07:27 PM

在CentOS上配置Hadoop分布式文件系统(HDFS)时,需要修改以下关键配置文件:core-site.xml:fs.defaultFS:指定HDFS的默认文件系统地址,例如hdfs://localhost:9000。hadoop.tmp.dir:指定Hadoop临时文件的存储目录。hadoop.proxyuser.root.hosts和hadoop.proxyuser.ro

See all articles