这篇文章主要介绍“Centos6.5怎么安装vsftpd+dhcp+nfs+tftp”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Centos6.5怎么安装vsftpd+dhcp+nfs+tftp”文章能帮助大家解决问题。
步骤
1、mount /dev/sr0 /media/
2、安装所需要的软件
安装并配置tftp服务
yum install tftp tftp-server vsftpd dhcp syslinux nfs-utils
vim /etc/xinetd.d/tftp
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
per_source = 11
cps = 100 2
flags = ipv4
}
配置dhcp
# dhcpd.conf
#
# sample configuration file for isc dhcpd
#
allow booting;
allow bootp;
# a slightly different configuration for an internal subnet.
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.50 192.168.1.60;
option domain-name-servers kangchangwei;
option domain-name "kangchangwei";
option routers 192.168.1.1;
default-lease-time 600;
max-lease-time 7200;
filename "pxelinux.0";
next-server 192.168.1.101;
}
以上ip可以根据自己所在的网络修改
3、复制所需要的启动文件
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot
cp /mnt/images/pxeboot/initrd.img /var/lib/tftpboot
cp /media/images/pxeboot/initrd.img /var/lib/tftpboot/
cp /media/images/pxeboot/vmlinuz /var/lib/tftpboot/
mkdir /var/lib/tftpboot/pxelinux.cfg
cp /media/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
编辑
vim /var/lib/tftpboot/pxelinux.cfg/default
default linux
#default vesamenu.c32
prompt 1
timeout 600
display boot.msg
menu background splash.jpg
menu title welcome to centos 6.5!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000
label linux
menu label ^install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img ks=ftp://192.168.1.101/pub/ks.cfg
label vesa
menu label install system with ^basic video driver
kernel vmlinuz
append initrd=initrd.img xdriver=vesa nomodeset
label rescue
menu label ^rescue installed system
kernel vmlinuz
append initrd=initrd.img rescue
label local
menu label boot from ^local drive
localboot 0xffff
label memtest86
menu label ^memory test
kernel memtest
append -
4、共享光盘
vim /etc/export
/media *(ro,sync)
启动nfs服务
[root@kcw ~]# /etc/init.d/rpcbind restart
停止 rpcbind: [确定]
正在启动 rpcbind: [确定]
[root@kcw ~]# /etc/init.d/nfs restart
关闭 nfs 守护进程: [确定]
关闭 nfs mountd: [确定]
关闭 nfs 服务: [确定]
shutting down rpc idmapd: [确定]
启动 nfs 服务: [确定]
启动 nfs mountd: [确定]
启动 nfs 守护进程: [确定]
正在启动 rpc idmapd: [确定]
查看nfs输出
[root@kcw ~]# showmount -e localhost
export list for localhost:
/media *
生成ks.cfg文件安装工具
[root@kcw ~]# yum install system-config-kickstart
然后运行
system-config-kickstart
来修改页面得到自己安装的客户端
我这里省略。。
这有个做好的ks.cfg
内容如下:
#platform=x86, amd64, or intel em64t
#version=devel
key --skip
# firewall configuration
firewall --disabled
# install os instead of upgrade
install
# use network installation
nfs --server=192.168.1.101 --dir=/media
# root password
rootpw --iscrypted $1$9elloihk$po.nfjnd/6k88z3ciivpc.
# network information
network --bootproto=dhcp --device=eth0 --onboot=on
# system authorization information
auth --useshadow --passalgo=md5
# use text mode install
text
# system keyboard
keyboard us
# system language
lang zh_cn
# selinux configuration
selinux --disabled
# do not configure the x window system
skipx
# installation logging level
logging --level=info
# reboot after installation
reboot
# system timezone
timezone asia/shanghai
# system bootloader configuration
bootloader --location=mbr
# clear the master boot record
zerombr
# partition clearing information
clearpart --all
# disk partitioning information
part swap --size 2048
part /boot --size 200
part pv.01 --size 30000
volgroup vol0 pv.01
logvol / --vgname=vol0 --size=25000 --name=root
#logvol /home --vgname=vol0 --size=500 --name=home
%post
#wget ftp://192.168.1.101/pub/yum.repo -p /etc/yum.repos.d/
%packages
@ desktop
@ console internet tools
@ desktop platform
@ development tools
@ general purpose desktop
@ graphical administration tools
@ internet browser
@ network file system client
@ printing client
@ x window system
@ chinese support
注意我这块root密码是redhat
我这里分区时lvm分区根据你的需求也可以修改
然后把ks.cfg放到你的vsftpd默认可以访问的目录里
即:
[root@kcw ~]# cd /var/ftp/pub/
[root@kcw pub]# ls
ks.cfg
[root@kcw pub]# pwd
/var/ftp/pub
注意先测试你的这个文件能不能访问打开ie
输入
看能否看到内容!
做完重启dhcp vsftpd xine xinetd nfs
然后重新开台电脑开机设置从网卡引导看能否启动成功并且自动安装
我这块等待默认600秒 自动安装
开机引导到boot:时按回车安装
关于“Centos6.5怎么安装vsftpd+dhcp+nfs+tftp”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识,可以关注亿速云行业资讯频道,小编每天都会为大家更新不同的知识点。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。
原文链接:https://www.xuebuyuan.com/3287934.html