您好,登錄后才能下訂單哦!
[root@localhost ~]# yum install epel-release -y ##安裝epel源
[root@localhost ~]# yum install -y \
> cobbler \ ##安裝cobbler\
> cobbler-web \ ##網頁形式管理
> dhcp \ ##地址分配服務
> tftp-server \ ##放壓縮和引導文件
> pykickstart \ ##Python開發的kickstart
> httpd \ ##網絡服務
> rsync \ ##遠程同步管理
> xinetd ##管理平臺
[root@localhost ~]# cd /etc/cobbler/
[root@localhost cobbler]# vim settings ##修改配置文件
next_server: 192.168.13.140 ##修改服務地址為本地
server: 192.168.13.140
manage_dhcp: 1 ##dhcp開啟
[root@localhost cobbler]# systemctl start httpd.service ##開啟http服務
[root@localhost cobbler]# systemctl start cobblerd.service ##開啟cobbler服務
[root@localhost cobbler]# systemctl stop firewalld.service ##關閉防火墻
[root@localhost cobbler]# setenforce 0 ##關閉增強功能
[root@localhost cobbler]# cobbler check ##cobbler檢測需要優化項
##下面會列出需要優化的東西,根據優化項進項優化即可
[root@localhost cobbler]# vim /etc/xinetd.d/tftp ##進行tftp優化
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no ##此處yes改為no
per_source = 11
cps = 100 2
flags = IPv4
}
[root@localhost cobbler]# systemctl enable rsyncd.service ##優化開啟遠程同步管理服務
[root@localhost cobbler]# openssl passwd -1 -salt 'abc123' 'abc123' ##優化設置管理員密碼
$1$abc123$9v8z2./E/PZihXrVcy3II0 ##復制此段是鹽值加密過后的密文
[root@localhost cobbler]# vim /etc/cobbler/settings ##修改配置文件
##查找default然后將加密的密文復制到此處
default_password_crypted: "$1$abc123$9v8z2./E/PZihXrVcy3II0"
[root@localhost cobbler]# systemctl start rsyncd.service ##啟動服務
[root@localhost cobbler]# systemctl restart xinetd.service
[root@localhost cobbler]# vim /etc/cobbler/dhcp.template ##修改配置文件
subnet 192.168.13.0 netmask 255.255.255.0 { ##修改網段
option routers 192.168.13.1; ##網關
option domain-name-servers 192.168.13.2; ##dns地址
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.13.100 192.168.13.200; ##地址池
[root@localhost cobbler]# cobbler sync ##同步生成DHCP配置文件(/etc/dhcp/dhcpd.conf)
[root@localhost cobbler]# systemctl restart dhcpd.service ##啟動dhcp服務
[root@localhost cobbler]# systemctl start cobblerd.service ##啟動cobbler服務
[root@localhost cobbler]# systemctl start xinetd.service ##啟動管理平臺服務
[root@localhost cobbler]# mount /dev/cdrom /mnt ##將鏡像掛載到/mnt目錄下
mount: /dev/sr0 寫保護,將以只讀方式掛載
[root@localhost cobbler]# cd /mnt/
[root@localhost mnt]# ls ##查看鏡像文件
CentOS_BuildTag GPL LiveOS RPM-GPG-KEY-CentOS-7
EFI images Packages RPM-GPG-KEY-CentOS-Testing-7
EULA isolinux repodata TRANS.TBL
[root@localhost mnt]# cobbler import --path=/mnt/ --name=Centos-7-x86_64 --arch=x86_64
##導入鏡像文件指明路徑,生成名字
[root@localhost mnt]# cd /var/www/cobbler/ks_mirror/ ##切換到cobbler目錄下
[root@localhost ks_mirror]# ls
Centos-7-x86_64 config
[root@localhost ks_mirror]# cobbler list ##查看文件信息
distros:
Centos-7-x86_64
profiles:
Centos-7-x86_64
systems:
repos:
images:
mgmtclasses:
packages:
files:
[root@localhost ks_mirror]# yum install tree -y ##安裝tree工具
[root@localhost ks_mirror]# tree /var/lib/tftpboot/images ##查看壓縮內核和引導文件
/var/lib/tftpboot/images
└── Centos-7-x86_64
├── initrd.img ##引導文件
└── vmlinuz ##壓縮內核
[root@localhost ks_mirror]# systemctl restart cobblerd.service
[root@localhost ks_mirror]# systemctl restart dhcpd.service
[root@localhost ks_mirror]# systemctl restart xinetd.service
[root@localhost ks_mirror]# systemctl restart httpd.service
代碼:[root@localhost ~]#yum groupinstall "GNOME Desktop"
代碼:[root@localhost ~]# yum groupinstall 'KDE Plasma Workspaces" -y
代碼:[root@localhost ~]# yum groupinstall "X Window System" 或者"Graphical Administration Tools"
[root@localhost ks_mirror]# vim /etc/cobbler/modules.conf ##配置模塊配置文件
module = authn_configfile ##默認開啟
[root@localhost ks_mirror]# htdigest -c /etc/cobbler/users.digest Cobbler adadmin ##創建用戶密碼
Adding password for adadmin in realm Cobbler.
New password: ##輸入密碼
Re-type new password:
[root@localhost ks_mirror]# systemctl restart cobblerd.service ##重啟cobbler服務
[root@localhost ks_mirror]# systemctl restart httpd.service ##重啟httpd服務
[root@localhost ks_mirror]# vim /etc/cobbler/modules.conf ##修改模塊配置文件
[authentication]
module = authn_pam ##修改成pam認證模塊
[authorization]
module = authz_ownership ##指定訪問權限
[root@localhost ks_mirror]# useradd webuser ##創建系統用戶
[root@localhost ks_mirror]# passwd webuser ##設置密碼
更改用戶 webuser 的密碼 。
新的 密碼:
無效的密碼: 密碼少于 8 個字符
重新輸入新的 密碼:
passwd:所有的身份驗證令牌已經成功更新。
[root@localhost ks_mirror]# vim /etc/cobbler/users.conf ##修改cobbler下的users.conf文件
[admins]
admin = ""
cobbler = ""
webuser = "" ##添加用戶
[root@localhost ks_mirror]# systemctl restart httpd.service ##重啟服務
[root@localhost ks_mirror]# systemctl restart cobblerd.service
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。