日期:2012-02-06 16:38:00 来源:本站整理
CentOS Linux 进级内核步骤、办法[服务器安全]
本文“CentOS Linux 进级内核步骤、办法[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
当前系统为CentOS Linux release 6.0 (Final),内核版本为2.6.32-71.el6.i686.由于近来内核呈现最新的漏洞(linux kernel 又爆内存提权漏洞,2.6.39 内核无一幸免,所以将内核进级至3.2.2最新版本.
1. 查看当前系统内核
# uname -r
2 2.6.32-71.el6.i686
2. 下载linux-3.2.2内核包
# cd ~
# wget -c http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.2.tar.bz2
# tar jxvf linux-3.2.2.tar.bz2
# cd linux-3.2.2
3. 配置内核并安装
# make mrproper #排除环境变量,即排除配置文件
# make menuconfig #在菜单情势下挑选需求编译的内核模块
找到以下选中选项并选中networking support → networking options → network packet filtering framework(netfilter)
(1).Core netfilter configuration
勾中”Netfilter connection tracking support” -m state相关模块是依靠它的,不选则没有.
将netbios name service protocal support(new) 编译成模块,不然背面进级iptables后启动时会出错
勾中“Netfilter Xtables support (required for ip_tables)”
(2).IP: Netfilter Configuration
将 “IPv4 connection tracking support (require for NAT)” 编译成模块.
勾中IP tables support (required for filtering/masq/NAT) .
将 “Full NAT” 下的 “MASQUERADE target support” 和 “REDIRECT target support” 编译成模块
(3).别的模块可以按照自己的需求举行挑选,若不懂可以参考内核配置手册.
# make clean #确保全部东西均保持最新状况.
# make bzImage #生成内核文件
# make modules #编译模块
# make modules_install #安装模块
# make install #安装
4. 编辑 /etc/grub.conf 文件,将 default=1 改成 default=0
# cat /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS Linux (3.2.2)
root (hd0,0)
kernel /vmlinuz-3.2.2 ro root=/dev/mapper/VolGroup-lv_root rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet
initrd /initramfs-3.2.2.img
title centos (2.6.32-71.el6.i686)
root (hd0,0)
kernel /vmlinuz-2.6.32-71.el6.i686 ro root=/dev/mapper/VolGroup-lv_root rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet
initrd /initramfs-2.6.32-71.el6.i686.img
5. 重启系统,并查看内核
# reboot
# uname -r
3.2.2
以上是“CentOS Linux 进级内核步骤、办法[服务器安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |
评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论