CentOS 7基于cobbler实现系统的自动化安装

1 环境准备

两台主机
一台主机:CentOS 7充当Cobbler,http,dhcp,tftp服务器,并关闭防火墙和SELinux
一台主机:充当测试机,用于实现自动化安装Linux系统
网络要求:关闭Vmware软件中的NAT模式中的DHCP服务,两个主机网卡基于NAT模式

2 安装相关包并启动服务

[root@centos7 ~]# yum -y install cobbler dhcp
[root@centos7 ~]# systemctl enable --now cobblered httpd tftp dhcpd

3 修改cobbler相关的配置

[root@centos7 ~]# cobbler check
The following are potential configuration items that you may want to fix:

1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work.  This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
3 : change 'disable' to 'no' in /etc/xinetd.d/tftp
4 : Some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely.  Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.
5 : enable and start rsyncd.service with systemctl
6 : debmirror package is not installed, it will be required to manage debian deployments and repositories
7 : ksvalidator was not found, install pykickstart
8 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one
9 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

Restart cobblerd and then run 'cobbler sync' to apply changes.

#生成新密码,默认安装好的系统root密码为cobbler
[root@centos7 ~]# openssl passwd -1 "centos"
$1$9vZJIjET$U4BI/SLRSPqs5a71tZ.lh1

#根据以上提示,只需做1,2,8这三项即可,修改下面四行
[root@centos7 ~]#vim /etc/cobbler/settings
default_password_crypted: "$1$9vZJIjET$U4BI/SLRSPqs5a71tZ.lh1"
next_server: 10.0.0.7		#tftp服务器的地址
server: 10.0.0.7			#cobbler服务器的地址
manage_dhcp: 1		#设置为1,表示通过cobbler生成dhcp.conf配置文件

[root@centos7 ~]# systemctl restart cobblerd

4 实现dhcp服务

#修改dhcp的模板文件下面的行,用来生成dhcp的配置文件
[root@centos7 ~]#vim /etc/cobbler/dhcp.template
subnet 10.0.0.0 netmask 255.255.255.0 {
     option routers             10.0.0.2;
     option domain-name-servers 180.76.76.76,223.5.5.5;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        10.0.0.50 10.0.0.100;

[root@centos7 ~]# cobbler sync
task started: 2020-09-09_214154_sync
task started (id=Sync, time=Wed Sep  9 21:41:54 2020)
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
copying distros to tftpboot
copying images
generating PXE configuration files
generating PXE menu structure
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
rendering TFTPD files
generating /etc/xinetd.d/tftp
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: dhcpd -t -q
received on stdout: 
received on stderr: 
running: service dhcpd restart
received on stdout: 
received on stderr: Redirecting to /bin/systemctl restart dhcpd.service

running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.manage_genders
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
[root@centos7 ~]# systemctl start dhcpd

5 下载启动的相关文件

[root@centos7 ~]# cobbler get-loaders
task started: 2020-09-09_214411_get_loaders
task started (id=Download Bootloader Content, time=Wed Sep  9 21:44:11 2020)
downloading https://cobbler.github.io/loaders/README to /var/lib/cobbler/loaders/README
downloading https://cobbler.github.io/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilo
downloading https://cobbler.github.io/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot
downloading https://cobbler.github.io/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux
downloading https://cobbler.github.io/loaders/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efi
downloading https://cobbler.github.io/loaders/yaboot-1.3.17 to /var/lib/cobbler/loaders/yaboot
downloading https://cobbler.github.io/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0
downloading https://cobbler.github.io/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32
downloading https://cobbler.github.io/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi
downloading https://cobbler.github.io/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi
*** TASK COMPLETE ***
[root@centos7 ~]# ls /var/lib/cobbler/loaders/
COPYING.elilo     COPYING.yaboot  grub-x86_64.efi  menu.c32    README
COPYING.syslinux  elilo-ia64.efi  grub-x86.efi     pxelinux.0  yaboot
[root@centos7 ~]# tree /var/lib/tftpboot/
/var/lib/tftpboot/
├── boot
│   └── grub
│       └── menu.lst
├── etc
├── grub
│   ├── efidefault
│   └── images -> ../images
├── images
├── images2
├── memdisk
├── menu.c32
├── ppc
├── pxelinux.0
├── pxelinux.cfg
│   └── default
└── s390x
    └── profile_list

10 directories, 7 files
[root@centos7 ~]# cobbler sync
task started: 2020-09-09_214658_sync
task started (id=Sync, time=Wed Sep  9 21:46:58 2020)
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
copying: /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
trying hardlink /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
copying: /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
trying hardlink /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboot
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying images
generating PXE configuration files
generating PXE menu structure
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
rendering TFTPD files
generating /etc/xinetd.d/tftp
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: dhcpd -t -q
received on stdout: 
received on stderr: 
running: service dhcpd restart
received on stdout: 
received on stderr: Redirecting to /bin/systemctl restart dhcpd.service

running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.manage_genders
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***

[root@centos7 ~]# tree /var/lib/tftpboot/
/var/lib/tftpboot/
├── boot
│   └── grub
│       └── menu.lst
├── etc
├── grub
│   ├── efidefault
│   ├── grub-x86_64.efi
│   ├── grub-x86.efi
│   └── images -> ../images
├── images
├── images2
├── memdisk
├── menu.c32
├── ppc
├── pxelinux.0
├── pxelinux.cfg
│   └── default
├── s390x
│   └── profile_list
└── yaboot

10 directories, 10 files

6 修改菜单的标题信息(可选)

[root@centos7 ~]# vim /etc/cobbler/pxe/pxedefault.template
MENU TITLE Cobbler | http://www.kingdom_24.com/

[root@centos7 ~]# cobbler sync
[root@centos7 ~]# cat /var/lib/tftpboot/pxelinux.cfg/default 
DEFAULT menu
PROMPT 0
MENU TITLE Cobbler | http://www.kingdom_24.com/
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT local

LABEL local
        MENU LABEL (local)
        MENU DEFAULT
        LOCALBOOT -1



MENU end

[root@centos7 ~]# cobbler sync

7 导入CentOS系统的安装文件,生成相应的YUM源

[root@centos7 ~]# yum -y install autofs
[root@centos7 ~]# systemctl enable --now autofs
Created symlink from /etc/systemd/system/multi-user.target.wants/autofs.service to /usr/lib/systemd/system/autofs.service.
[root@centos7 ~]# ls /misc/cd
CentOS_BuildTag  EULA  images    LiveOS    repodata              RPM-GPG-KEY-CentOS-Testing-7
EFI              GPL   isolinux  Packages  RPM-GPG-KEY-CentOS-7  TRANS.TBL
#提前挂载好centos 6 7和8的镜像文件
[root@centos7 ~]# yum -y install autofs
[root@centos7 ~]# systemctl enable --now autofs
[root@centos7 ~]# ls /misc/cd
AppStream  BaseOS  EFI  images  isolinux  media.repo  TRANS.TBL
[root@centos7 ~]# cobbler import --name=centos-8.0-x86_64 --path=/misc/cd --arch=x86_64
task started: 2020-09-12_104926_import
task started (id=Media import, time=Sat Sep 12 10:49:26 2020)
Found a candidate signature: breed=redhat, version=rhel8
Found a matching signature: breed=redhat, version=rhel8
Adding distros from path /var/www/cobbler/ks_mirror/centos-8.0-x86_64:
creating new distro: centos-8.0-x86_64
trying symlink: /var/www/cobbler/ks_mirror/centos-8.0-x86_64 -> /var/www/cobbler/links/centos-8.0-x86_64
creating new profile: centos-8.0-x86_64
associating repos
checking for rsync repo(s)
checking for rhn repo(s)
checking for yum repo(s)
starting descent into /var/www/cobbler/ks_mirror/centos-8.0-x86_64 for centos-8.0-x86_64
processing repo at : /var/www/cobbler/ks_mirror/centos-8.0-x86_64/AppStream
need to process repo/comps: /var/www/cobbler/ks_mirror/centos-8.0-x86_64/AppStream
looking for /var/www/cobbler/ks_mirror/centos-8.0-x86_64/AppStream/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/centos-8.0-x86_64/AppStream/repodata
processing repo at : /var/www/cobbler/ks_mirror/centos-8.0-x86_64/BaseOS
need to process repo/comps: /var/www/cobbler/ks_mirror/centos-8.0-x86_64/BaseOS
looking for /var/www/cobbler/ks_mirror/centos-8.0-x86_64/BaseOS/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/centos-8.0-x86_64/BaseOS/repodata
*** TASK COMPLETE ***
[root@centos7 ~]# mkdir /mnt/centos{6,7}
[root@centos7 ~]# mount /dev/sr1 /mnt/centos7
[root@centos7 ~]# mount CentOS-6.10-x86_64-minimal.iso /mnt/centos6
[root@centos7 ~]# cobbler import --name=centos-7.8-x86_64 --path=/mnt --arch=x86_64
task started: 2020-09-12_105729_import
task started (id=Media import, time=Sat Sep 12 10:57:29 2020)
Found a candidate signature: breed=redhat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a matching signature: breed=redhat, version=rhel7
Adding distros from path /var/www/cobbler/ks_mirror/centos-7.8-x86_64:
creating new distro: centos-7.8-x86_64
trying symlink: /var/www/cobbler/ks_mirror/centos-7.8-x86_64 -> /var/www/cobbler/links/centos-7.8-x86_64
creating new profile: centos-7.8-x86_64
associating repos
checking for rsync repo(s)
checking for rhn repo(s)
checking for yum repo(s)
starting descent into /var/www/cobbler/ks_mirror/centos-7.8-x86_64 for centos-7.8-x86_64
processing repo at : /var/www/cobbler/ks_mirror/centos-7.8-x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/centos-7.8-x86_64
looking for /var/www/cobbler/ks_mirror/centos-7.8-x86_64/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/centos-7.8-x86_64/repodata
*** TASK COMPLETE ***
[root@centos7 ~]# cobbler import --name=centos-6.10-x86_64 --path=/mnt/centos6 --arch=x86_64
[root@centos7 ~]# du -sh /var/www/cobbler/ks_mirror/*
449M	/var/www/cobbler/ks_mirror/centos-6.10-x86_64
1001M	/var/www/cobbler/ks_mirror/centos-7.8-x86_64
6.8G	/var/www/cobbler/ks_mirror/centos-8.0-x86_64
12K	/var/www/cobbler/ks_mirror/config
[root@centos7 ~]# cobbler distro list
   centos-6.10-x86_64
   centos-7.8-x86_64
   centos-8.0-x86_64
[root@centos7 ~]# cobbler profile list
   CentOS-7.8_production
   CnetOS-8.0_production
   centos-6.10-x86_64

#默认生成的是最小化安装

在这里插入图片描述

8 准备kickstart文件,并关联至指定的YUM源

[root@centos7 ~]# vim /var/lib/cobbler/kickstarts/centos8.cfg
ignoredisk --only-use=sda
zerombr
text
reboot
clearpart --all --initlabel
selinux --disabled
firewall --disabled
url --url=$tree	#注意此行必须指定
keyboard --vckeymap=us --xlayouts='us'
lang en_US.UTF-8
network --bootproto=dhcp --device=eth0 --ipv6=auto --activate
bootloader --append="net.ifnames=0" --location=mbr --boot-drive=sda
network --hostname=centos8.kobe.com
rootpw --iscrypted $6$ZqApgQaeO0mXFWe.$IBfhxqiDlWcrgIKkjexjBltP8R2UXdM/PkvQ4GvnXl25Zzcoh4ZrrhFv9.dEZrm6oSjEDSJ7KwonWEh54JsiL0
firstboot --enable
skipx
services --disabled="chronyd"
timezone Asia/Shanghai --isUtc --nontp
user --name=kobe --password=$6$7a9OGZdtOAnEiJtN$p7xoQYfKKEjCKTzUPxb4R3fW/.jrS7BoC14j3IUzF8LxgDTDJaxnhneby4F7dW/fQH6W/huYlkeuiFeaRxzC81 --iscrypted --gecos="kobe"
#autopart --type=lvm
#part / --fstype xfs --size 1 --grow --ondisk sda 可以实现根自动使用所有剩余空间
part / --fstype="xfs" --ondisk=sda --size=102400
part /data --fstype="xfs" --ondisk=sda --size=51200
part swap --fstype="swap" --ondisk=sda --size=2048
part /boot --fstype="ext4" --ondisk=sda --size=1024
%packages
@^minimal-environment
kexec-tools
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
%post
mkdir /etc/yum.repos.d/backup
mv /etc/yum.repos.d/* /etc/yum.repos.d/backup
cat > /etc/yum.repos.d/base.repo <<EOF
[base]
name=CentOS-\$releasever Base
#baseurl=file:///misc/cd/BaseOS
baseurl=https://mirrors.aliyun.com/centos/\$releasever/BaseOS/\$basearch/os/
        https://mirrors.huaweicloud.com/centos/\$releasever/BaseOS/\$basearch/os/
enabled=1
gpgcheck=0

[AppStream]
name=CentOS-\$releasever Appstream
#baseurl=file:///misc/cd/AppStream
baseurl=https://mirrors.aliyun.com/centos/\$releasever/AppStream/\$basearch/os/
        https://mirrors.huaweicloud.com/centos/\$releasever/AppStream/\$basearch/os/
enabled=1
gpgcheck=0

[epel]
name=CentOS-\$releasever Epel
baseurl=https://mirrors.aliyun.com/epel/\$releasever/Everything/\$basearch/
        https://mirrors.huaweicloud.com/epel/\$releasever/Everything/\$basearch/
enabled=1
gpgcheck=0

[extras]
name=CentOS-\$releasever Extras
baseurl=https://mirrors.aliyun.com/centos/\$releasever/extras/\$basearch/os/
        https://mirrors.huaweicloud.com/centos/\$releasever/extras/\$basearch/os/ 
enabled=1
gpgcheck=0
EOF
%end

[root@centos7 ~]# vim /var/lib/cobbler/kickstarts/centos7.cfg
install
xconfig --startxonboot
keyboard --vckeymap=us --xlayouts='us'
rootpw --iscrypted $6$ZqApgQaeO0mXFWe.$IBfhxqiDlWcrgIKkjexjBltP8R2UXdM/PkvQ4GvnXl25Zzcoh4ZrrhFv9.dEZrm6oSjEDSJ7KwonWEh54JsiL0
url --url=$tree
lang en_US
auth --useshadow --passalgo=sha512
text
firstboot --enable
selinux --disabled
skipx
services --disabled="chronyd"
ignoredisk --only-use=sda
firewall --disabled
network --bootproto=dhcp --device=eth0
network --hostname=centos7.kobe.com
reboot
timezone Asia/Shanghai --nontp
bootloader --append="net.ifnames=0" --location=mbr --boot-drive=sda
zerombr
#autopart --type=lvm
clearpart --all --initlabel
part swap --fstype="swap" --ondisk=sda --size=2048
part / --fstype="xfs" --ondisk=sda --size=102400
part /boot --fstype="xfs" --ondisk=sda --size=1024
part /data --fstype="xfs" --ondisk=sda --size=51200
%post
useradd kobe
echo centos | passwd --stdin kobe
mkdir /etc/yum.repos.d/backup
mv /etc/yum.repos.d/* /etc/yum.repos.d/backup
cat > /etc/yum.repos.d/base.repo <<EOF
[base]
name=CentOS-\$releasever Base
baseurl=https://mirrors.aliyun.com/centos/\$releasever/os/\$basearch/
        https://mirrors.huaweicloud.com/centos/\$releasever/os/\$basearch/
enabled=1
gpgcheck=0

[epel]
name=CentOS-\$releasever Epel
baseurl=https://mirrors.aliyun.com/epel/\$releasever/\$basearch/
        https://mirrors.huaweicloud.com/epel/\$releasever/\$basearch/ 
enabled=1
gpgcheck=0

[extras]
name=CentOS-\$releasever Extras
baseurl=https://mirrors.aliyun.com/centos/\$releasever/extras/\$basearch/
        https://mirrors.huaweicloud.com/centos/\$releasever/extras/\$basearch/ 
enabled=1
gpgcheck=0
EOF
%end
%packages
@core
%end

[root@centos7 ~]# vim /var/lib/cobbler/kickstarts/centos6.cfg
install
text
reboot
url --url=$tree
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --bootproto dhcp --noipv6 --hostname centos6.kobe.com
rootpw --iscrypted $6$ZqApgQaeO0mXFWe.$IBfhxqiDlWcrgIKkjexjBltP8R2UXdM/PkvQ4GvnXl25Zzcoh4ZrrhFv9.dEZrm6oSjEDSJ7KwonWEh54JsiL0
firewall --disabled
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone  Asia/Shanghai
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
zerombr
clearpart --all --initlabel
part /boot --fstype=ext4 --size=1024
part / --fstype=ext4 --size=102400
part /data --fstype=ext4 --size=51200
part swap --size=2048
%packages
@core
@server-policy
@workstation-policy
%end
%post
useradd kobe
echo centos | passwd --stdin kobe &> /dev/null
mkdir /etc/yum.repos.d/backup
mv /etc/yum.repos.d/* /etc/yum.repos.d/backup
cat > /etc/yum.repos.d/base.repo <<EOF
[base]
name=CentOS-\$releasever Base
baseurl=https://mirrors.aliyun.com/centos/\$releasever/os/\$basearch/
        https://mirrors.huaweicloud.com/centos/\$releasever/os/\$basearch/
enabled=1
gpgcheck=0

[epel]
name=CentOS-\$releasever Epel
baseurl=https://mirrors.aliyun.com/epel/\$releasever/\$basearch/
        https://mirrors.huaweicloud.com/epel/\$releasever/\$basearch/ 
enabled=1
gpgcheck=0

[extras]
name=CentOS-\$releasever Extras
baseurl=https://mirrors.aliyun.com/centos/\$releasever/extras/\$basearch/
        https://mirrors.huaweicloud.com/centos/\$releasever/extras/\$basearch/ 
enabled=1
gpgcheck=0
EOF
%end

#将kickstart文件,关联至指定的YUM源和生成菜单列表
[root@centos7 ~]# cobbler profile add --name=CentOS-8.0_production --distro=CentOS-8.0-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos8.cfg
[root@centos7 ~]# cobbler profile add --name=CentOS-7.8_production --distro=CentOS-7.8-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos7.cfg
[root@centos7 ~]# cobbler profile add --name=CnetOS-6.10_production --distro=CentOS-6.10-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos6.cfg

#删除默认生成的菜单
[root@centos7 ~]# cobbler profile remove --name=CentOS-8.0-x86_64
[root@centos7 ~]# cobbler profile remove --name=CentOS-7.8-x86_64
[root@centos7 ~]# cobbler profile remove --name=centos-6.10-x86_64

[root@centos7 ~]# cobbler profile list
   CentOS-7.8_production
   CnetOS-6.10_production
   CnetOS-8.0_production

9 测试客户端基于Cobbler实现自动安装

在这里插入图片描述
安装成功示例:
在这里插入图片描述
在这里插入图片描述

10 支持UEFI安装

注意:CentOS6的虚拟机不支持UEFI
修改文件设置时间,默认不显示菜单

#修改模板文件
[root@centos7 ~]# vim /etc/cobbler/pxe/efidefault.template
default=0
timeout=60

$grub_menu_items

#使模板生效
[root@centos7 ~]# cobbler sync

#验证生效
[root@centos7 ~]# head -2 /var/lib/tftpboot/grub/efidefault 
default=0
timeout=60

设置客户端启动使用UEFI
在这里插入图片描述
启动客户机可以如下界面
在这里插入图片描述

选择对应的菜单进行自动安装
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

11 实现cobbler的web管理

[root@centos7 ~]# yum -y install cobbler-web
[root@centos7 ~]# systemctl restart httpd

通过浏览器访问:https://10.0.0.7/cobbler_web
在这里插入图片描述
点高级后,继续点访问10.0.0.7(不安全)
在这里插入图片描述
在这里插入图片描述
用户名:cobbler,密码:cobbler
在这里插入图片描述
在这里插入图片描述

12 创建cobbler自定义的web用户

[root@centos7 ~]# cat /etc/cobbler/users.digest 
cobbler:Cobbler:a2d6bae81669d707b72c0bd9806e01f3
[root@centos7 ~]# htdigest -c /etc/cobbler/users.digest Cobbler admin
Adding password for admin in realm Cobbler.
New password: 
Re-type new password: 
[root@centos7 ~]# cat /etc/cobbler/users.digest 
admin:Cobbler:461941848a17e1b412f94c100a79bf75
3
[root@centos7 ~]# htdigest /etc/cobbler/users.digest Cobbler admin2
Adding user admin2 in realm Cobbler
New password: 
Re-type new password: 
[root@centos7 ~]# cat /etc/cobbler/users.digest 
admin:Cobbler:461941848a17e1b412f94c100a79bf75
3
admin2:Cobbler:8e3ab6cc196fac11dcf0512c200a672f

使用上面创建的用户登录web界面,登录成功后可以看到下面界面
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值