Chinaunix首页 | 论坛 | 博客
  • 博客访问: 10804283
  • 博文数量: 2905
  • 博客积分: 20098
  • 博客等级: 上将
  • 技术积分: 36298
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-23 05:00
文章存档

2012年(1)

2011年(3)

2009年(2901)

分类: LINUX

2009-03-23 11:07:05

#/bin/bash
#System Configuration Steps:
#Created by ritto.zhao
#MSN:
#12.15.2008 学习笔记
#Kernel 2.6+、CentOS 5.2
#Change gateway
sed -i 's#GATEWAY=192.168.4.1#GATEWAY=192.168.4.3#' /etc/sysconfig/network
/etc/init.d/network restart
#Disable IPv6
cp /etc/modprobe.conf /etc/modprobe.conf.bak
echo "alias net-pf-10 off" >> /etc/modprobe.conf
echo "alias ipv6 off" >> /etc/modprobe.conf
#Disable selinux
cp /etc/sysconfig/selinux /etc/sysconfig/selinux.bak
sed -i 's#SELINUX=enforcing#SELINUX=disabled#' /etc/sysconfig/selinux
#Set system time
yum -y install ntp
/usr/sbin/ntpdate cn.pool.ntp.org
#/usr/sbin/ntpdate 210.72.145.44 && clock -w
echo "/usr/sbin/ntpdate cn.pool.ntp.org && clock -w" >> /etc/rc.local
#Stop unuseful services
chkconfig --list | grep 3:on | awk '{print $1}' | egrep -v 'sshd|network|syslog' | xargs -i{} chkconfig --level 3 {} off
chkconfig --list | grep 3:on | cut -f1
reboot
-------------------------------------------------------------
#Load cdrom
mount /dev/cdrom /media
#Set yum source use local cdrom
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.bak
mv CentOS-Media.repo CentOS-Media.repo.bak
vi dvdiso.repo
[DVDISO]
name=DVD ISO
baseurl=file:///media/
enable=1
gpgcheck=0
-------------------------------------------------------------
#Yum source in internet
cd /etc/yum.repos.d
mv CentOS-Base.repo  CentOS-Base.repo.save
wget
阅读(793) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~