您好,登录后才能下订单哦!
密码登录
登录注册
点击 登录注册 即表示同意《亿速云用户服务条款》
[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进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。