文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>无人值守安装CentOS5

无人值守安装CentOS5

时间:2010-07-13  来源:billsuliang

1. 基础服务配置
yum install tftp-server dhcp http   vi /etc/xinetd.d/tftp service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
  vi /etc/dhcpd.conf ddns-update-style interim;
ignore client-updates;
##allow booting;
#allow bootp;
#class "pxeclients" {
#match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
#next-server 192.168.1.13;  #dhcp服务器地址
#filename "/pxelinux.0";
#}
next-server 192.168.1.13;   #PXE服务器IP地址
filename "/pxelinux.0";              
subnet 192.168.1.0 netmask 255.255.255.0 {
# --- default gateway
option routers                192.168.1.13;
option subnet-mask              255.255.255.0;
option time-offset  -18000; # Eastern Standard Time
range dynamic-bootp 192.168.170.128 192.168.170.254;
default-lease-time 21600;
max-lease-time 43200;
group pxe {
host CentOS5-3 {
     next-server 192.168.170.51;
     hardware ethernet 08:00:27:B0:D6:37;
     fixed-address 192.168.170.53;
}
host CentOS5-2 {
     next-server 192.168.170.51;
     hardware ethernet 08:00:27:9c:6a:58;
     fixed-address 192.168.170.52;
}
}
}
  2. 配置pxe引导文件 mkdir /tftpboot
cp /usr/lib/syslinux/pxelinux.0 /tftpboot
cd /var/www/html/centOS/image/pxeboot/
cp initrd.img vmlinux /tftpboot/
cp /var/www/html/centOS/isolinux/*.msg /tftpboot
cd /tftpboot; mkdir pxelinux.cfg
cp /var/www/html/centOS/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default

vi /tftpboot/pxelinux.cfg/default
default linux
prompt 1
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux
  kernel vmlinuz
  append ks=http://192.168.1.13/centOS/ks.cfg initrd=initrd.img devfs=nomount ramdisk_size=9216
label text
  kernel vmlinuz
  append initrd=initrd.img text
label ks
  kernel vmlinuz
  append ks initrd=initrd.img
label local
  localboot 1
label memtest86
  kernel memtest
  append -
  3安装kickstart配置文件生成工具
yum install system-config-kickstart
启动system-config-kickstart选择每一步的配置后,保存ks.cfg文件到/var/www/html/centOS/

vi /var/www/html/centOS/ks.cfg
#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Use graphical install
graphical
# Firewall configuration
firewall --enabled --ssh  
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Installation logging level
logging --level=info
# Use network installation
url --url=http://192.168.170.51/CentOS5-4
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
#Root password
rootpw --iscrypted $1$5CDBM987$ZKf7pjiIaMaPsnSYq63Lf0

# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone  America/New_York
# Install OS instead of upgrade
install
# Disk partitioning information
part swap --bytes-per-inode=4096 --fstype="swap" --size=512
part / --bytes-per-inode=4096 --fstype="ext3" --size=10240
%post  --interpreter=/bin/bash
chkconfig --level 35 atd off
chkconfig --level 35 acpid off
chkconfig --level 35 anacron off
chkconfig --level 35 apmd off
chkconfig --level 35 auditd off
chkconfig --level 35 autofs off
chkconfig --level 35 bluetooth off
chkconfig --level 35 cpuspeed off
chkconfig --level 35 iptables off
chkconfig --level 35 ip6tables off
chkconfig --level 35 isdn off
chkconfig --level 35 messagebus off
chkconfig --level 35 pcmcia off
chkconfig --level 35 xinetd off
chkconfig --level 35 sendmail off
chkconfig --level 35 yum-updatesd off
chkconfig --level 35 smartd off
touch /tmp/no_problem
%packages
@server-cfg
@base-x
@dialup
@gnome-desktop
@development-libs
@development-tools
@x-software-development
@admin-tools
@legacy-software-development
@gnome-software-development
@chinese-support
@ruby
@graphical-internet
@system-tools
@editors

没有测试redhat,网上说需要
vi /tftpboot/pxelinux.cfg/default
auth --useshadow --enablemd5
key --skip #这行一定要,跳过注册号输入
相关阅读 更多 +
排行榜 更多 +
<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />

<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />

飞行射击 下载
<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />

<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />

飞行射击 下载
<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />

<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />

飞行射击 下载