历史Linux镜像的问题修复方案
历史Linux镜像创建的ECS云服务器,可能存在NTP没有配置,YUM没有配置,还可能存在最近暴漏较高的安全漏洞,请按照以下步骤进行修复,可以让您的云服务器更加安全,还可以使用阿里云提供的YUM服务进行安装软件,可以使用免费的阿里云提供的NTP进行时间同步。
1. 配置NTP
不区分发行版,先备份 /etc/ntp.conf,然后将其内容替换为如下:
# ntp.conf
#
# ntpd config for aliyun ecs.
#
# 6LAN+6LAN+3WAN
# shijun.cao@alibaba-inc.com
# 2014.8.11
#
driftfile /var/lib/ntp/drift
pidfile /var/run/ntpd.pid
logfile /var/log/ntp.log
# Access Control Support
restrict default ignore
restrict -6 default ignore
restrict 127.0.0.1
restrict 192.168.0.0 mask 255.255.0.0 nomodify notrap nopeer noquery
restrict 172.16.0.0 mask 255.240.0.0 nomodify notrap nopeer noquery
restrict 100.64.0.0 mask 255.192.0.0 nomodify notrap nopeer noquery
restrict 10.0.0.0 mask 255.0.0.0 nomodify notrap nopeer noquery
restrict ntp1.aliyun.com nomodify notrap nopeer noquery
restrict ntp2.aliyun.com nomodify notrap nopeer noquery
restrict ntp3.aliyun.com nomodify notrap nopeer noquery
restrict ntp4.aliyun.com nomodify notrap nopeer noquery
restrict ntp5.aliyun.com nomodify notrap nopeer noquery
restrict ntp6.aliyun.com nomodify notrap nopeer noquery
# local clock
server 127.127.1.0
fudge 127.127.1.0 stratum 10
#public ntp server
server ntp1.aliyun.com iburst minpoll 4 maxpoll 10
server ntp2.aliyun.com iburst minpoll 4 maxpoll 10
server ntp3.aliyun.com iburst minpoll 4 maxpoll 10
server ntp4.aliyun.com iburst minpoll 4 maxpoll 10
server ntp5.aliyun.com iburst minpoll 4 maxpoll 10
server ntp6.aliyun.com iburst minpoll 4 maxpoll 10
#Private ntp server
server ntp1.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp2.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp3.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp4.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp5.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp6.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
#New private ntp server
server ntp7.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp8.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp9.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp10.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp11.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp12.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
2. 更新软件源
0 . 先确认镜像当前的 Linux 系统发行版和版本号。
如果有 lsb_release 命令,执行:
lsb_release -a
否则执行
cat /etc/issue
1 . 对于 CentOS,备份 /etc/yum.repos.d/ 下的 CentOS-Base.repo 和 epel.repo 文件,根据 CentOS 版本,执行如下相应的命令:
CentOS 5:
wget -qO /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
wget -qO /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-5.repo
CentOS 6:
wget -qO /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
wget -qO /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
CentOS 7:
wget -qO /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -qO /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
repo 文件下载完成后,执行:
yum makecache
2 . 对于 Aliyun 5.7,备份 /etc/yum.repos.d/CentOS-Base.repo ,然后执行:
wget -qO /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/aliyun-5.repo
repo 文件下载完成后,执行:
yum makecache
3 . 对于 Ubuntu,备份 /etc/apt/sources.list 文件,根据发行版版本,执行命令:
ubuntu12.04:
wget -qO /etc/apt/sources.list http://mirrors.aliyun.com/repo/ubuntu1204-lts.list
ubuntu14.04:
wget -qO /etc/apt/sources.list http://mirrors.aliyun.com/repo/ubuntu1404-lts.list
然后执行:
apt-get update
4 . 对于 Debian,备份 /etc/apt/sources.list 文件,根据发行版版本,执行命令:
debian6:
wget -qO /etc/apt/sources.list http://mirrors.aliyun.com/repo/debian6-lts.list
debian7:
wget -qO /etc/apt/sources.list http://mirrors.aliyun.com/repo/debian7-lts.list
然后执行:
apt-get update
3. 安全漏洞修复补丁
主要修复目前已知的重大安全漏洞,需要升级的软件包括: bash 、glibc 、 openssl 、wget 、ntp 。
在执行如下命令之前,需要确保系统当前的软件源已经设置正确。
1 . 对于 CentOS 和 Aliyun Linux,执行:
yum update bash glibc openssl wget ntp
2 . 对于 Ubuntu 和 Debian,执行:
apt-get install bash libc6 libc-bin openssl wget ntp
历史Linux镜像的问题修复方案的更多相关文章
- Linux Glibc库严重安全漏洞修复方案通知(腾讯开发者社区)
如何查看当前glibc的版本号? rpm -aq | grep glibc 尊敬的用户: 您好!2015年1月28日, 腾讯云安全情报监测到LinuxGlibc库存在一处严重安全漏洞,可以 ...
- Bash漏洞批量检测工具与修复方案
<img src="http://image.3001.net/images/20140928/14118931103311.jpg!small" t ...
- Linux 系统故障排查和修复技巧
Linux 系统故障排查和修复技巧 我发现Linux系统在启动过程中会出现一些故障,导致系统无法正常启动,我在这里写了几个应用单用户模式.GRUB命令操作.Linux救援模式的故障修复案例帮助大家了解 ...
- 【转帖】Linux的历史----Linux内核剖析(一)
Linux的历史----Linux内核剖析(一) 2015年04月09日 10:51:09 JeanCheng 阅读数:11351更多 所属专栏: Linux内核剖析 版权声明:本文为博主原创文 ...
- 【渗透测试】NSA Windows 0day漏洞+修复方案
这个漏洞是前段时间爆出来的,几乎影响了全球70%的电脑,不少高校.政府和企业都还在用Windows服务器,这次时间的影响力堪称网络大地震. ------------------------------ ...
- Circle Linux镜像在阿里云镜像站首发上线
镜像下载.域名解析.时间同步请点击阿里云开源镜像站 Circle Linux简介 Circle Linux 社区是一个开源.共创的 Linux 社区,将通过完全开放.包容的社区形式与全球开发者共同构建 ...
- Android 热修复方案Tinker
转自:http://blog.csdn.net/l2show/article/details/53925543 Android 热修复方案Tinker(一) Application改造 Android ...
- 树莓派及其他硬件平台国内外Linux镜像站全汇总
转载至segmentfault. 本文收集整理国内对于Raspberry Pi.CubieBoard.pcDuino等各种Linux开源硬件平台,所使用的Raspbian.Arch Linux ARM ...
- 常见IE浏览器bug及其修复方案(双外边距、3像素偏移、绝对定位)
1. 双外边距浮动bug IE6和更低版本中存在双外边距浮动bug,顾名思义,这个Windows bug使任何浮动元素上的外边距加倍 bug重现: <!DOCTYPE html> < ...
随机推荐
- java基础编程——树的子结构
题目描述 输入两棵二叉树A,B,判断B是不是A的子结构.(ps:我们约定空树不是任意一个树的子结构) 题目代码 /** * 输入两棵二叉树A,B,判断B是不是A的子结构.(ps:我们约定空树不是任意一 ...
- KVM修改虚机网卡模式:由NAT模式改为Bridge模式
1)关闭虚机# virsh shutdown vm1 2)编辑虚机配置文件# virsh edit vm1 <interface type='default'> 改为<int ...
- 定位设备--llseek实现
/** 如果llseek实现lseek和llseek系统调用,如果未定义llseek方法, 内核默认修改file结构体中的f_pos成员来实现定位,如果是操作一个 设备,则需提供自己的llseek方法 ...
- 1503: [NOI2004]郁闷的出纳员
Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 13723 Solved: 4989[Submit][Status][Discuss] Descripti ...
- Mysql--子查询、分页查询、联合查询
一. 子查询的定义 出现在其他语句中的select语句,称为子查询或者内查询,外部的查询语句称为主查询或者外查询,子查询可以包含普通select可以包含的任何语句. 外部查询:select.inser ...
- centos7.4安装rabbitmq服务(3.7.10版本)
一.需要安装erlang版本依赖,可以使用二进制安装方式,也可以通过rpm安装,但是安装的时候会提示需要erlang版本>=19.3,而且直接默认yum仓库中的版本较低.,为了节省时间,文章中直 ...
- 解决Linux使用php命令 -base comment not found并安装composer
获取php的安装目录 使用 find / -name php.ini 查看php的安装位置 /usr/local/php/lib/php.ini # cd 到/usr/local/php/lib/ph ...
- CodeForces:#448 div2 B. XK Segments
传送门:http://codeforces.com/contest/895/problem/B B. XK Segments time limit per test1 second memory li ...
- shell脚本入门基础知识
shell 脚本的第一行 #!/bin/bash #!/bin/sh 其实,sh是bash的一个软链接 sh -> bash 变量,字母下划线开头(好像是没有类型的) #普通变量 var1=ni ...
- JVM垃圾回收原理
原文地址:http://chenchendefeng.iteye.com/blog/455883 一.相关概念 基本回收算法 1. 引用计数(Reference Counting) 比较古老的回收算法 ...