历史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> < ...
随机推荐
- 【BZOJ1030】[JSOI2007] 文本生成器(AC自动机上跑DP)
点此看题面 大致题意: 给你\(N\)个字符串(只含大写字母),要你求出有多少个由\(M\)个大写字母构成的字符串含有这\(N\)个字符串中的至少一个. \(AC\)自动机 看到题目,应该比较容易想到 ...
- vs code vim
很多初学者启动vim后,不知道怎么输入字符:按了半天字母,结果屏幕还是空的. vim和记事本或WORD不一样,不是一打开后就可以输入文字,此时它处于正常模式. vim一共有4个模式: 正常模式 (No ...
- vi中系统剪切板的设置
在vi中,如果编译时没有clipboard属性,将vi中的内容拷贝到系统剪切板有些麻烦.可以用如下的方法,查看vi 是否支持系统剪切板的功能: xt@xt-ThinkPad-X220:~$ vi -- ...
- HH的项链题解(离线思想+链表+树状数组)
本人第一篇博客重磅推出!!! 希望各位朋友以后多多捧场也多给写意见(我个人喜欢把题解写得啰嗦一点,因为这样方便理解,各位巨佬勿喷) 来讲一道提高+/省选-的骚题:HH的项链(这个HH你理解成皇后呵呵哈 ...
- 重载&重写
重载:同一个类中,方法名相同,方法参数不同(参数个数.参数类型),返回类型无关,所以返回类型不能作为重载的区别依据. 重写:子父类中,子类的方法名.参数位置.参数个数.返回类型和父类一致,方法体不同 ...
- shell数组脚本
#!/bin/bash array=( ) ;i<${#array[*]};i++)) do echo ${array[i]} done 脚本2 #!/bin/bash array=( ) fo ...
- 662. Maximum Width of Binary Tree
https://leetcode.com/problems/maximum-width-of-binary-tree/description/ /** * Definition for a binar ...
- 菜鸟学Linux - bash的配置文件
bash是各大Linux发行版都支持的shell.当我们登陆bash的时候,虽然我们什么都没做,但是我们已经可以在bash中调用各种各样的环境变量了.这是因为,系统中已经定义了一系列的配置文件,以及加 ...
- [项目1] bloger - day1
项目代码:https://github.com/venicid/Project1--Bloger 1.准备工作 1.创建project PS C:\Users\Administrator\Deskto ...
- Android 有些机型hint不显示
这个问题就是有些手机型号,hint字体正好和你的背景色一样,不如你的背景色是白色, 因为大多数的系统,hint都是灰色,所以可以显示,有些手机他妈的就是hint默认字体是白色,结果显示不出来. 那么就 ...