手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

RHEL7无人值守自动安装 DHCP+TFTP +SYSLINUX+FTP +Kickstart

[日期:2015-09-07] 来源:Linux社区  作者:Yolo [字体: ]

事实证明,上面的kickstart自定义配置是没错的,可以成功的无人值守安装,而且比复制~/ anaconda-ks.cfg文件安装的要快很多,不知道为什么

为了更好的了解配置,查看/var/ftp/pub/ks.cfg(刚刚用kickstart图形界面配置)的配置文件如下:

#platform=x86, AMD64, or Intel EM64T

#version=DEVEL

# Install OS instead of upgrade

install

# Keyboard layouts

keyboard 'us'# Reboot after installation

reboot

# Root password

rootpw --iscrypted $1$vVvwaH.E$laQ2SHKj2ej6/1C.YzU7Q.

# System timezone

timezone Africa/Abidjan

# Use network installation

url --url="ftp://192.168.65.2/"

# System language

lang en_US

# Firewall configuration

firewall --disabled

# Network information

network  --bootproto=dhcp --device=eth0

# System authorization information

auth  --useshadow  --passalgo=md5

# Use graphical install

graphical

# Run the Setup Agent on first boot

firstboot --enable

# SELinux configuration

selinux --disabled

# System bootloader configuration

bootloader --location=mbr

# Clear the Master Boot Record

zerombr

# Partition clearing information

clearpart --all 

# Disk partitioning information

part swap --fstype="swap" --size=2048

part /boot --fstype="xfs" --size=300

part / --fstype="xfs" --size=18131

%pre

--password=$6$d5.YwnmIoKU5KqgX$h1jmKofHk28yYz0LyD.HiOgOnK7F0.arKFn6mcwMofrNtCAeGWSq5pzcgyUbFBETA3EC.QVGZKMAbjpuMrjbE1 --iscrypted --gecos="ream"

%end

%post

/usr/sbin/adduser ream

/usr/sbin/usermod -p '$1$dq/RUYXu$KTztpGgYyUmDur05zgWZt1' ream

/usr/bin/chfn -f "ream" ream

mv /etc/rc.d/rc.local /etc/rc.d/rc.local.00

echo '#!/bin/bash' > /etc/rc.d/rc.local

ln -s ../rc.local /etc/rc.d/rc5.d/S99rclocal

chmod 755 /etc/rc.d/rc.local

echo 'mkdir -p /var/log/vmware' >> /etc/rc.d/rc.local

echo 'exec 1> /var/log/vmware/rc.local.log' >> /etc/rc.d/rc.local

echo 'exec 2>&1' >> /etc/rc.d/rc.local

echo 'set -x' >> /etc/rc.d/rc.local

echo 'echo Installing VMware Tools' >> /etc/rc.d/rc.local

echo 'set -x' >> /etc/rc.d/rc.local

echo '/bin/eject sr0 || /bin/true' >> /etc/rc.d/rc.local

echo '/bin/eject sr1 || /bin/true' >> /etc/rc.d/rc.local

echo '/bin/vmware-rpctool' \'guest.upgrader_send_cmd_line_args --default\' >> /etc/rc.d/rc.local

echo '/bin/vmware-rpctool' \'upgrader.setGuestFileRoot /tmp\' >> /etc/rc.d/rc.local

echo '/bin/vmware-rpctool' \'toolinstall.installerActive 1\' >> /etc/rc.d/rc.local

echo '/bin/vmware-rpctool' \'toolinstall.installerActive 100\' >> /etc/rc.d/rc.local

echo 'rm -f /etc/rc.d/rc.local' >> /etc/rc.d/rc.local

echo 'rm -f /etc/rc.d/rc5.d/S99rclocal' >> /etc/rc.d/rc.local

echo 'mv /etc/rc.d/rc.local.00 /etc/rc.d/rc.local' >> /etc/rc.d/rc.local

/bin/echo done

%end

%packages

@base

@core

@guest-desktop-agents

binutils

chrony

ftp

gcc

kernel-devel

make

open-vm-tools

patch

python

%end

6. 关闭防火墙,查看服务状态

[root@localhost ~]# systemctl stop firewall

[root@localhost ~]# systemctl status firewall

firewall.service

  Loaded: not-found (Reason: No such file or directory)

  Active: inactive (dead)

[root@localhost ~]#

查看DHCP状态

查看xinetd状态

查看tftp端口

查看ftp状态

四.测试

上面是服务器DHCP服务状态,可以看到dhcpack on 192.168.65.6 ,MAC00:0C:29:23:FD:8F的客户机获取到了

如下客户机的MAC地址

00:0C:29:23:FD:8F

安装完成,自动进入登陆界面

更多RedHat相关信息见RedHat 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=10

本文永久更新链接地址http://www.linuxidc.com/Linux/2015-09/122765.htm

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款