您好,登錄后才能下訂單哦!
這篇文章主要為大家展示了“cobbler如何實現自動化無人值守安裝”,內容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領大家一起研究并學習一下“cobbler如何實現自動化無人值守安裝”這篇文章吧。
root@localhost ~]# yum install epel-release -y ##安裝源碼包 ##安裝必要組件 yum install -y \ cobbler \ ##安裝cobbler\ cobbler-web \ ##網頁形式管理 dhcp \ ##地址分配服務 tftp-server \ ##放壓縮和引導文件 pykickstart \ ##Python開發的kickstart httpd \ ##網絡服務 rsync \ ##遠程同步管理 xinetd ##管理平臺
[root@localhost ~]# cd /etc/cobbler/ [root@localhost cobbler]# ls auth.conf import_rsync_whitelist pxe users.conf cheetah_macros iso reporting users.digest cobbler_bash ldap rsync.exclude version completions modules.conf rsync.template zone.template dhcp.template mongodb.conf secondary.template zone_templates dnsmasq.template named.template settings genders.template power tftpd.template [root@localhost cobbler]# vim settings 278 next_server: 192.168.136.179 ##修改地址為服務器地址 279 server: 192.168.136.179 ##添加服務器地址 280 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 [root@localhost cobbler]# vim /etc/xinetd.d/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 ##此處改為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' ##設置管理員密碼 Password: $1$abc123ab$Z6awNYIN3LrF2YlvXPh6N. ##復制此段是鹽值加密過后的密文 [root@localhost cobbler]# vim /etc/cobbler/settings 101 default_password_crypted: "$1$abc123ab$Z6awNYIN3LrF2YlvXPh6N." ##第101行把我們剛才設置的 密碼的密文復制到此處 [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.136.0 netmask 255.255.255.0 { ##修改本地服務器的網段 option routers 192.168.136.1; option domain-name-servers 192.168.136.1; option subnet-mask 255.255.255.0; range dynamic-bootp 192.168.136.100 192.168.136.254; ##地址池 [root@localhost cobbler]# cobbler sync ##同步生成dhcp配置文件(/etc/dhcp/dhcp.conf) task started: 2019-11-15_154150_sync task started (id=Sync, time=Fri Nov 15 15:41:50 2019) running pre-sync triggers cleaning trees [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 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
以上是“cobbler如何實現自動化無人值守安裝”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。